Skip to content

Commit

Permalink
Merge pull request #19 from Explore-In-HMS/dev
Browse files Browse the repository at this point in the history
Merge branch 'dev' into main
  • Loading branch information
htk007 authored Oct 13, 2023
2 parents e34065f + f7828c4 commit 318e3d6
Show file tree
Hide file tree
Showing 133 changed files with 22,730 additions and 18,799 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ render.experimental.xml

# AG Services (e.g. APIs)
agconnect-services.json
app/agconnect-services.json

# Android Profiling
*.hprof
39 changes: 21 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ android {

defaultConfig {
applicationId "com.hms.explorehms"
minSdkVersion 28
minSdkVersion 29
targetSdkVersion 33
versionCode gradleVersionCode
versionName gradleVersionName
Expand Down Expand Up @@ -153,7 +153,7 @@ dynamicFeatures =
':feature_modem5g_kit',
':feature_videoeditorkit',
':feature_navikit',
':feature_videoeditorkitai'
//':feature_videoeditorkitai'
]

packagingOptions {
Expand Down Expand Up @@ -259,13 +259,13 @@ dependencies {
api 'com.huawei.agconnect:agconnect-core:1.8.0.300'

//Analytics Kit
api 'com.huawei.hms:hianalytics:6.10.0.300'
api 'com.huawei.hms:hianalytics:6.10.0.302'

//cloud storage
api "com.huawei.agconnect:agconnect-storage:1.5.0.100"
api "com.huawei.agconnect:agconnect-storage:1.9.1.300"

//DTM
api 'com.huawei.hms:dtm-api:6.6.0.304'
api 'com.huawei.hms:dtm-api:6.6.0.305'

//hquic
implementation 'com.huawei.hms:hquic-provider:5.0.1.300'
Expand All @@ -274,19 +274,19 @@ dependencies {
api 'com.huawei.hms:dynamicability:1.0.18.300'

//Location Kit
implementation 'com.huawei.hms:location:6.9.0.300'
implementation 'com.huawei.hms:location:6.11.0.301'

//Site Kit
implementation 'com.huawei.hms:site:6.5.1.300'

//Account Kit
api 'com.huawei.hms:hwid:6.9.0.301'
api 'com.huawei.hms:hwid:6.11.0.300'

// Scan Kit
implementation 'com.huawei.hms:scan:2.10.0.301'
implementation 'com.huawei.hms:scan:2.11.0.300'

//Cloud functions sdk
api 'com.huawei.agconnect:agconnect-function:1.8.0.300'
api 'com.huawei.agconnect:agconnect-function:1.9.1.300'

//audio kit
api 'com.huawei.hms:audiokit-player:1.6.0.300'
Expand Down Expand Up @@ -410,7 +410,7 @@ dependencies {
// ML KIT END

//nearby
api 'com.huawei.hms:nearby:6.9.0.300'
api 'com.huawei.hms:nearby:6.11.0.300'

//Video Kit
// api "com.huawei.hms:videokit-player:1.0.10.302"
Expand All @@ -430,7 +430,7 @@ dependencies {
api 'com.huawei.scenekit:scenekit-iphysics-utils:6.0.0.301'*/

//App linking
api 'com.huawei.agconnect:agconnect-applinking:1.8.0.300'
api 'com.huawei.agconnect:agconnect-applinking:1.9.1.300'

//FIDO
api 'com.huawei.hms:fido-fido2:6.7.0.300'
Expand All @@ -440,10 +440,10 @@ dependencies {
api 'com.huawei.hms:awareness:3.4.0.302'

//Push Kit
api 'com.huawei.hms:push:6.9.0.300'
api 'com.huawei.hms:push:6.11.0.300'

//MAP kit
api "com.huawei.hms:maps:6.9.0.300"
api "com.huawei.hms:maps:6.11.0.304"
//api 'com.huawei.hms:maps-advance:6.4.1.300'

//Ads Kit
Expand All @@ -455,19 +455,19 @@ dependencies {
api 'com.huawei.hms:image-vision:1.0.3.306'

//Game Kit
api "com.huawei.hms:game:6.8.0.300"
api "com.huawei.hms:game:6.10.0.300"

//Drive Kit
api 'com.huawei.hms:drive:5.0.0.307'
api 'com.huawei.hms:drive:5.2.0.300'

//Crash Service
api 'com.huawei.agconnect:agconnect-crash:1.8.0.300'
api 'com.huawei.agconnect:agconnect-crash:1.9.0.300'

//Remote Configuration
api 'com.huawei.agconnect:agconnect-remoteconfig:1.8.0.300'
api 'com.huawei.agconnect:agconnect-remoteconfig:1.9.1.300'

//App Messaging
api 'com.huawei.agconnect:agconnect-appmessaging:1.8.0.300'
api 'com.huawei.agconnect:agconnect-appmessaging:1.9.1.300'

//AR Engine
api 'com.huawei.hms:arenginesdk:4.0.0.5'
Expand Down Expand Up @@ -498,6 +498,9 @@ dependencies {

//Keyring Service
implementation "com.huawei.hms:keyring-credential:6.7.0.303"
//App Update (Third Party)
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':app_update')
}

/*apply from: '../sonarqube.gradle'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.io.File;
import java.io.FileInputStream;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;

public class FileSizeUtil {
public static String TAG = "FileSizeUtil";
Expand Down Expand Up @@ -69,7 +71,7 @@ private static long getFileSizes(File f) throws Exception {
}

private static double FormetFileSize(long fileS, int sizeType) {
DecimalFormat df = new DecimalFormat("#.00");
DecimalFormat df = new DecimalFormat("#.00", DecimalFormatSymbols.getInstance(Locale.ENGLISH));
double fileSizeLong = 0;
switch (sizeType) {
case SIZETYPE_B:
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature android:name="android.hardware.camera.any" />
<uses-feature android:name="android.hardware.camera.autofocus" />

Expand All @@ -51,8 +59,14 @@
android:resizeableActivity="false"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:keepScreenOn="true"
android:usesCleartextTraffic="true"
tools:replace="name, icon, label, theme, resizeableActivity, allowBackup, hardwareAccelerated,android:networkSecurityConfig, android:configChanges">

<activity android:name=".CustomsUpdateActivity"
android:theme="@style/UpdateDialog">
</activity>

<activity
android:name=".locationkit.IndoorLocationActivity"
android:exported="false">
Expand Down Expand Up @@ -151,6 +165,7 @@
<action android:name="com.hms.explorehms.locationkit.ACTION_PROCESS_LOCATION" />
</intent-filter>
</receiver>

<receiver
android:name=".locationkit.GeoFenceBroadcastReceiver"
android:enabled="true"
Expand Down
Binary file added app/src/main/fruit_marker-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/fruit_marker_icon-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions app/src/main/java/com/hms/explorehms/CustomsUpdateActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.hms.explorehms;

import androidx.fragment.app.Fragment;

import com.kcode.lib.dialog.UpdateActivity;

public class CustomsUpdateActivity extends UpdateActivity {
@Override
protected Fragment getUpdateDialogFragment() {
return CustomsUpdateFragment.newInstance(mModel,"当前已经是最新版本");
}
}
46 changes: 46 additions & 0 deletions app/src/main/java/com/hms/explorehms/CustomsUpdateFragment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.hms.explorehms;

import android.os.Bundle;
import android.view.View;

import com.kcode.lib.bean.VersionModel;
import com.kcode.lib.common.Constant;
import com.kcode.lib.dialog.UpdateDialog;

public class CustomsUpdateFragment extends UpdateDialog {

public static CustomsUpdateFragment newInstance(VersionModel model, String toastMsg) {

Bundle args = new Bundle();
args.putSerializable(Constant.MODEL, model);
args.putString(Constant.TOAST_MSG, toastMsg);
CustomsUpdateFragment fragment = new CustomsUpdateFragment();
fragment.setArguments(args);
return fragment;
}

@Override
protected int getLayout() {
return R.layout.fragment_update_dialog;
}

@Override
protected void setContent(View view, int contentId) {
super.setContent(view, R.id.content);
}

@Override
protected void bindUpdateListener(View view, int updateId) {
super.bindUpdateListener(view, R.id.btnUpdate);
}

@Override
protected void bindCancelListener(View view, int cancelId) {
super.bindCancelListener(view, R.id.cancel);
}

@Override
protected void initIfMustUpdate(View view, int id) {
super.initIfMustUpdate(view, R.id.cancel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@

import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.SearchView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentContainerView;
import androidx.viewpager2.widget.ViewPager2;

Expand All @@ -35,6 +38,7 @@
import com.hms.explorehms.baseapp.fragment.HmsKitSearchFragment;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.kcode.lib.UpdateWrapper;

public class MainActivityTab extends AppCompatActivity {

Expand All @@ -43,6 +47,8 @@ public class MainActivityTab extends AppCompatActivity {
FragmentContainerView searchFragmentContainer;
HmsKitSearchFragment searchFragment;

private static final String TAG = "App_Update";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -51,7 +57,32 @@ protected void onCreate(Bundle savedInstanceState) {

initUI();
initAdapter();

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
checkUpdate(0, null);

}
private void checkUpdate(final long time, final Class<? extends FragmentActivity> cls) {

UpdateWrapper.Builder builder = new UpdateWrapper.Builder(getApplicationContext())
.setTime(time)
.setNotificationIcon(R.mipmap.ic_launcher_round)
.setUrl("https://raw.githubusercontent.com/Explore-In-HMS/Explore-Hms/App_Update/app/update-changelog.json")
.setIsShowToast(false)
.setIsShowNetworkErrorToast(true)
.setIsShowBackgroundDownload(true)
.setCallback((model, hasNewVersion) -> {
Log.d(TAG, String.valueOf(hasNewVersion));
Log.d(TAG, "has new version:" + hasNewVersion + ";version info :" + model.getVersionName());
});

if (cls != null) {
builder.setCustomsActivity(cls);
}
builder.build().start();
}



// @Override
// public int getLayoutRes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ public void onItemClick(View v) {
getCurrentLocationGeoFence();
break;
case R.id.btn_createGeoFence:
createFromTextGeoData();

String conversionValue = etSetConversions.getText().toString();
if(conversionValue.equals("1") || conversionValue.equals("2") || conversionValue.equals("4")){
createFromTextGeoData();
}
break;
case R.id.btn_showGeoList:
String result = GeoFenceCreateActivity.GeoFenceData.showGeoFenceData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.hms.explorehms.locationkit;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.annotation.SuppressLint;
import android.content.Intent;
Expand Down Expand Up @@ -72,11 +73,29 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_indoor_location);

initView();
setupToolbar();
initListeners();
createFusedLocationProviderClient();

}

private void setupToolbar() {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}

/**
* Called when the user presses the "back" button in the toolbar.
* It handles the behavior for navigation.
*/
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}

private void initView(){
//TextViews
tv_resultLogs = findViewById(R.id.resultLogsIndoor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -53,12 +54,18 @@ public void initializeUI() {
moveCamera(generateRandomLocation()));
binding.btnAnimateCameraMapkit.setOnClickListener(view1 ->
animateCamera(generateRandomLocation()));
binding.btnScalePerPixelMapkit.setOnClickListener(view ->
getScalePerPixel());
}

private void moveCamera(LatLng latLng) {
hMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, hMap.getCameraPosition().zoom));
}

private void getScalePerPixel(){
Toast.makeText(requireContext(),Float.toString(hMap.getScalePerPixel()),Toast.LENGTH_LONG).show();
}

private void animateCamera(LatLng latLng) {
hMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, hMap.getCameraPosition().zoom), 1500, null);
}
Expand Down
Loading

0 comments on commit 318e3d6

Please sign in to comment.