liuzhenxing1118 3 жил өмнө
parent
commit
22ed63e798

+ 1 - 0
.idea/misc.xml

@@ -7,6 +7,7 @@
         <entry key="app/src/main/res/drawable-xhdpi/button_shape.xml" value="0.124" />
         <entry key="app/src/main/res/drawable/view_shape.xml" value="0.112" />
         <entry key="app/src/main/res/drawable/xp_checkbox.xml" value="0.112" />
+        <entry key="app/src/main/res/layout/activity_action.xml" value="0.379981884057971" />
         <entry key="app/src/main/res/layout/activity_apn_delete.xml" value="0.19300911854103345" />
         <entry key="app/src/main/res/layout/activity_blackdoor_password.xml" value="0.3695652173913043" />
         <entry key="app/src/main/res/layout/activity_change_progress.xml" value="0.1" />

+ 10 - 3
app/src/main/java/com/xplora/xpsettings/Activity/ApnDeleteActivity.java

@@ -24,6 +24,7 @@ import java.util.List;
 
 public class ApnDeleteActivity extends BaseActivity {
     public int mIndex = 0;
+    public String name = "";
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -35,15 +36,21 @@ public class ApnDeleteActivity extends BaseActivity {
 
     private void initData() {
         mIndex = getIntent().getIntExtra(Constant.INENT_LIST_INDEX, 0);
+        name = getIntent().getStringExtra(Constant.INENT_VIEW_VALUE);
     }
 
     private void initView() {
-        TextView textView = findViewById(R.id.text_content);
+        TextView textContent = findViewById(R.id.text_content);
+        TextView textName = findViewById(R.id.text_name);
         Button cancelButton = findViewById(R.id.button_cancel);
         Button sureButton = findViewById(R.id.button_sure);
 
-        if (textView != null) {
-            textView.setText(R.string.apn_delete_content);
+        if (textContent != null) {
+            textContent.setText(R.string.apn_delete_content);
+        }
+
+        if (textName != null) {
+            textName.setText(name);
         }
 
         if (cancelButton != null) {

+ 10 - 0
app/src/main/java/com/xplora/xpsettings/Activity/ApnEditActivity.java

@@ -97,6 +97,8 @@ public class ApnEditActivity extends BaseActivity {
                 setResult(RESULT_OK, intent);
                 finish();
             } else if (msg.what == Constant.MSG_SURE_CLICK) {
+                if (!check())
+                    return;
                 Intent intent = new Intent();
                 intent.setAction(Constant.INENT_RESULT_ACTION);
                 intent.putExtra(Constant.INENT_RESULT_VALUE, mApnModel);
@@ -106,6 +108,14 @@ public class ApnEditActivity extends BaseActivity {
         }
     };
 
+    private boolean check() {
+        if (mApnModel.apn_name.isEmpty()) {
+            toast(getString(R.string.input_app_name));
+            return false;
+        }
+        return true;
+    }
+
     @Override
     protected void onStop() {
         super.onStop();

+ 1 - 0
app/src/main/java/com/xplora/xpsettings/Activity/ApnListActivity.java

@@ -105,6 +105,7 @@ public class ApnListActivity extends BaseActivity {
                     return;
                 Intent intent = new Intent(ApnListActivity.this, ApnDeleteActivity.class);
                 intent.putExtra(Constant.INENT_LIST_INDEX, position);
+                intent.putExtra(Constant.INENT_VIEW_VALUE, mDataList.get(position).title);
                 startActivityForResult(intent, 0);
             }
         });

+ 14 - 0
app/src/main/res/layout/activity_action.xml

@@ -16,6 +16,20 @@
         android:textAlignment="center"
         />
 
+    <TextView
+        android:id="@+id/text_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_below="@+id/text_content"
+        android:layout_marginTop="10dp"
+        android:textSize="12sp"
+        android:textFontWeight="400"
+        android:textColor="#FFFFFFFF"
+        android:fontFamily="Roboto"
+        android:textAlignment="center"
+        />
+
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="50dp"

+ 3 - 0
app/src/main/res/layout/item_title_subtitle.xml

@@ -20,10 +20,13 @@
                 android:id="@+id/item_title"
                 android:layout_width="wrap_content"
                 android:layout_height="18dp"
+                android:layout_marginEnd="20dp"
                 android:fontFamily="Roboto"
                 android:textColor="@color/white"
                 android:textFontWeight="500"
                 android:textSize="12sp"
+                android:ellipsize="end"
+                android:maxLines="1"
                 />
 
             <TextView

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -51,4 +51,5 @@
     <string name="source_announcement_2">If you would like to obtain the complete corresponding source code for a period of two years after the last shipment of this product by sending an email to support@xplora.com</string>
 
     <string name="password_wrong">Wrong password!</string>
+    <string name="input_app_name">Input app name</string>
 </resources>