Bläddra i källkod

添加授权按钮

Pressure_Cooker
liup 1 månad sedan
förälder
incheckning
309c655c11
9 ändrade filer med 100 tillägg och 3 borttagningar
  1. +10
    -0
      .idea/deploymentTargetSelector.xml
  2. +13
    -0
      .idea/easycode.ignore
  3. +6
    -0
      .idea/git_toolbox_blame.xml
  4. +0
    -1
      .idea/misc.xml
  5. +1
    -1
      app/release/output-metadata.json
  6. +18
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java
  7. +25
    -1
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home4Fragment.java
  8. +10
    -0
      app/src/main/res/drawable/btn_authorize.xml
  9. +17
    -0
      app/src/main/res/layout/fragment_home4.xml

+ 10
- 0
.idea/deploymentTargetSelector.xml Visa fil

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

+ 13
- 0
.idea/easycode.ignore Visa fil

@@ -0,0 +1,13 @@
node_modules/
dist/
vendor/
cache/
.*/
*.min.*
*.test.*
*.spec.*
*.bundle.*
*.bundle-min.*
*.*.js
*.*.ts
*.log

+ 6
- 0
.idea/git_toolbox_blame.xml Visa fil

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxBlameSettings">
<option name="version" value="2" />
</component>
</project>

+ 0
- 1
.idea/misc.xml Visa fil

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK" />

+ 1
- 1
app/release/output-metadata.json Visa fil

@@ -13,7 +13,7 @@
"attributes": [],
"versionCode": 1,
"versionName": "1.0.0",
"outputFile": "boluo-xiaochao-v1-202409251252-release.apk"
"outputFile": "boluo-xiaochao-v1-202409251542-release.apk"
}
],
"elementType": "File"

+ 18
- 0
app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigation2Activity.java Visa fil

@@ -10,6 +10,7 @@ import com.bonait.bnframework.business.ConfigData;
import com.bonait.bnframework.business.ModbusHelper;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.helper.AuthorizeHelper;
import com.bonait.bnframework.common.utils.NetworkUtils;
import com.google.android.material.bottomnavigation.BottomNavigationView;

@@ -59,6 +60,23 @@ public class BottomNavigation2Activity extends BaseActivity {
viewPager.setOffscreenPageLimit(3);
bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
Init();
new Thread(){
@Override
public void run() {
try{
Thread.sleep(1500);
runOnUiThread(new Runnable() {
@Override
public void run() {
AuthorizeHelper.AuthorizeNotify(BottomNavigation2Activity.this);
AuthorizeHelper.AuthorizeInAdvanceNotify(BottomNavigation2Activity.this);
}
});
}catch (Exception e){

}
}
}.start();
}

@Override


+ 25
- 1
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home4Fragment.java Visa fil

@@ -15,6 +15,7 @@ import android.os.Bundle;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

@@ -24,11 +25,13 @@ import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.Constants;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.helper.AuthorizeHelper;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.utils.UpdateAppUtils;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
import com.bonait.bnframework.modules.home.activity.BottomNavigation2Activity;
import com.bonait.bnframework.modules.home.fragment.from.BunkerSetupActivity;
import com.bonait.bnframework.modules.home.fragment.from.CpxzActivity;
import com.bonait.bnframework.modules.home.fragment.from.DishTestActivity;
@@ -51,6 +54,8 @@ public class Home4Fragment extends BaseFragment {

@BindView(R.id.yauser_gn)
LinearLayout yauser_gn;//
@BindView(R.id.authorize)
Button authorize;//
private Context context;

@Override
@@ -66,6 +71,22 @@ public class Home4Fragment extends BaseFragment {
context = getContext();
initTopBar();
initData();
new Thread(){
@Override
public void run() {
try{
Thread.sleep(3000);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
authorize.setVisibility(ConfigName.getInstance().IsVisibleAuthorize?View.VISIBLE:View.GONE);
}
});
}catch (Exception e){

}
}
}.start();
}

/**
@@ -80,7 +101,7 @@ public class Home4Fragment extends BaseFragment {
*
* @param view
*/
@OnClick({R.id.kaishipengren, R.id.shebeikongzhi, R.id.zhuxiaodenglu
@OnClick({R.id.kaishipengren, R.id.shebeikongzhi, R.id.zhuxiaodenglu,R.id.authorize
, R.id.liaochangshezhi, R.id.caipinyanfa,R.id.check_update})
public void onViewClicked(View view) {
switch (view.getId()) {
@@ -93,6 +114,9 @@ public class Home4Fragment extends BaseFragment {
case R.id.liaochangshezhi:
OpenActivity(SystemParSetActivity.class);
break;
case R.id.authorize:
AuthorizeHelper.AuthorizeDialog((AppCompatActivity)getActivity());
break;
case R.id.check_update:
checkPermission();
break;


+ 10
- 0
app/src/main/res/drawable/btn_authorize.xml Visa fil

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:right="10dp" android:height="50dp" >
<shape android:shape="rectangle">
<solid android:color="#E91E63"/>
<corners android:topRightRadius="20dp" android:bottomRightRadius="20dp"/>
</shape>
</item>
<!-- <item android:drawable="@mipmap/home_exit" android:gravity="left|center" android:height="40dp" android:width="40dp" android:left="10dp"/>-->
</layer-list>

+ 17
- 0
app/src/main/res/layout/fragment_home4.xml Visa fil

@@ -139,5 +139,22 @@
android:background="@mipmap/check_update"
android:elevation="40dp"></RelativeLayout>

<Button
android:id="@+id/authorize"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="0dp"
android:layout_marginBottom="150dp"
android:text="授权"
android:textStyle="bold"
android:visibility="gone"
android:textSize="30dp"
android:gravity="center|center"
android:textColor="@color/white"
tools:visibility="visible"
android:background="@drawable/btn_authorize"
android:elevation="40dp"></Button>
</RelativeLayout>
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout>

Laddar…
Avbryt
Spara