From d3a1ee6b9c4ee9bdee00824529b0fa7d82bc3e23 Mon Sep 17 00:00:00 2001 From: 1414299616 <1414299616@qq.com> Date: Sun, 27 Aug 2023 23:44:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../top/wherewego/switchapp/MainActivity.java | 37 ++++++++++++++++++ .../res/layout/status_config_info_item.xml | 10 ++++- app/src/main/res/mipmap-hdpi/delete.png | Bin 0 -> 1476 bytes app/src/main/res/mipmap-hdpi/delete2.png | Bin 0 -> 1337 bytes 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/mipmap-hdpi/delete.png create mode 100644 app/src/main/res/mipmap-hdpi/delete2.png diff --git a/app/src/main/java/top/wherewego/switchapp/MainActivity.java b/app/src/main/java/top/wherewego/switchapp/MainActivity.java index 24015c2..402a9f4 100644 --- a/app/src/main/java/top/wherewego/switchapp/MainActivity.java +++ b/app/src/main/java/top/wherewego/switchapp/MainActivity.java @@ -1,14 +1,18 @@ package top.wherewego.switchapp; +import android.content.DialogInterface; import android.content.Intent; import android.util.Log; import android.view.View; +import android.widget.Toast; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.RecyclerView; +import com.google.gson.Gson; import com.hjq.bar.OnTitleBarListener; import com.hjq.bar.TitleBar; import com.scwang.smart.refresh.layout.SmartRefreshLayout; @@ -19,6 +23,7 @@ import top.wherewego.switchapp.adapter.StatusAdapter; import top.wherewego.switchapp.app.AppActivity; import top.wherewego.switchapp.app.AppApplication; +import top.wherewego.switchapp.util.SPUtils; import top.wherewego.switchjni.ConfigurationInfoBean; import top.wherewego.widget.layout.WrapRecyclerView; @@ -56,6 +61,19 @@ public void onRightClick(TitleBar titleBar) { mAdapter = new StatusAdapter(this); mAdapter.setOnItemClickListener(this); + mAdapter.setOnChildClickListener(R.id.iv_delete, (recyclerView, childView, position) -> { + AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.this) + .setTitle("") + .setMessage("是否选择删除该项?") + .setPositiveButton("确认", (dialog, id) -> { + String key = mAdapter.getItem(position).getKey(); + deleteItem(key); + mAdapter.removeItem(position); + }) + .setNegativeButton("取消", (dialog, id) -> dialog.cancel()); + alert.show(); + + }); mRecyclerView.setAdapter(mAdapter); mRefreshLayout.setOnRefreshLoadMoreListener(this); @@ -68,6 +86,23 @@ public void onRightClick(TitleBar titleBar) { }); } + public void deleteItem(String key){ + String keyset = SPUtils.getString(getApplicationContext(), "keyset", "0"); + StringBuilder newKeySet = new StringBuilder(); + if (keyset.equals("0")) { + return; + } else { + String[] keys = keyset.split(","); + for (String s : keys) { + if (!s.equals(key)) { + newKeySet.append(s).append(","); + } + } + SPUtils.putString(getApplicationContext(), "keyset", newKeySet.toString()); + } + SPUtils.deleteShare(getApplicationContext(),key); + } + @Override protected void initData() { //analogData(); @@ -81,6 +116,8 @@ protected void onResume() { mRefreshLayout.finishRefresh(); } + + @Override public void onItemClick(RecyclerView recyclerView, View itemView, int position) { selectConfigurationInfoBean = mAdapter.getItem(position); diff --git a/app/src/main/res/layout/status_config_info_item.xml b/app/src/main/res/layout/status_config_info_item.xml index 502ceaa..e6fffac 100644 --- a/app/src/main/res/layout/status_config_info_item.xml +++ b/app/src/main/res/layout/status_config_info_item.xml @@ -3,7 +3,7 @@ + + (Xa$?)FPWSo#{-c{neSyoqNyBJ?HQFF75NCXs8*g z0RW&uqmtx;0DhnGGyotHXk^!eX9MNMu6`0LR4QQ!7w!54 zQ8s7j?Y3K$r6r?LV=WliWOsH>0LLadG^zN>{SaD2+mHAxdtpNV8onpbZ;gyEbC1vd zpaw^7g@F+83mP>~L<4Xnh19f429Q`|*!a9Q3=6TqbtusC+WDh1 zD_hLNM)jn!%9d>whMOtS_2J>5ioyMHxFcodM=u!1Jd~h8<#W1 zUaDs-&9nT8LZ>5{1-yGJx_cnv`@2;$vtgg&ZFQLP*;iEN%t*%b(ID$%b*6A0pOz5l z^7W_jkTZExO^k^2^08*k=Yk#`8KY||!vbWvSKc)N^;OG$SYjmh#W46yS};Zq4xUL4 z3t3_;G$>MPJJBK?a~$MIU-gs!R`cwBim1~p1~Zw%UPOxCbm32D`u2~3Pu3#C9}X9E zMlI@iAgy{k5UqP(XKDS_PX##2T0Y4 z$98JMQCLm><3lOHV^80rL^o(xlWwpMe6y`@r1FhipvL~s+iazwi#v!!&xTsr9%Oxc#=42fR}QGPmrOEJmMV^M#Q4I z*Bg&aWpT~!M(hW1=UOn11;q91=(2YOiQ<4*>38@oko@rQN6zx?&w z4QNx0-)66mH**6~W4}&~~n}K)sopfwV%c`LS^T zT2$&B9H#{%-bzzG+up8%q(d7uR5dK(bA70%4;?UvVjx|W^K>cCh$YG2Oj1KWx;^ed zg_Q#eZ;btBu{$LwoAa=p+8w?Bq4M>@!R0b0uKc6hUxxcZ>c^0TvN*)_v z8Jz^|fWQ1XmWZr6T z`4Q-?P{*Or>3>I0d>PKD~|3E)GJD>%w{Z4l5-)Mh;L*f=a$Q#`tixHw1je?x*zwY<@` zh?!t01xc@=nHa2t>B?8#6YAur3C>-84})wv1{~TZeLSE$(X%wAh(0@&ZN9#rw&&hh zLUi9PEsm~=oN4*O=eA5g$gx_JSQ7}MM6I_qP68*iKJoy%7wFEiyp;AGG}gjvFw~I$H^*|B{IU%K**Yo6L7(Cj9}k Ckb*k^ literal 0 HcmV?d00001 diff --git a/app/src/main/res/mipmap-hdpi/delete2.png b/app/src/main/res/mipmap-hdpi/delete2.png new file mode 100644 index 0000000000000000000000000000000000000000..57a729361551634f11a0b7e68c6d61008769b945 GIT binary patch literal 1337 zcmWkue^Al~9Q^=a=nEJjnF<3%vsUU9I$Poo1daKtvg?cAy zh%g5?4vpt3Hk{Kr9fh48JA%xEw-(q(1U=Z*!2W<2#ywDaXY@$T1^E>1Xr28(S9Hb7 zx9!GARe>7P|TeD+2U0KAy~OCUEb?@WP5VgUC2B z?7aM7(#cNm4-*D{42@wsU$mUhra{2%ZU{BWi^w;HhnkVWyb9|Q<-2O-?%CJS?E8#W zj6x0?+Urd+Qt+=GrFe@*6g@i%*L|xPIwI^t{Y;qz5fz{1NX1oYL>Y<#sQ0a6>6Sqj z>erh|6;bfxj#R=kjVMO(9&Y+t7*YiGqah{_f|82g=aAq$D@D5%dGMW&g(dY<{*8w8 zdQkNq_*V`IK~`yuRybh0Pb))8R6a%nP00kkJ3hy;75AvZn4vfX7t!XPWU}6^BtPhB z+SIYf@-eYt$&-hRwX>gsq%=;RifEM#FzfDP*~!WqvSmp2Skr=yg#yf)pbs;UA)J0u zD<=W2q#U~dZk@x4(;5E+*|V+09a0N*tfiwyr1t{8fr(tgO{(SilI>7!Yl_t~MB>?* zw9=%X`%ROV=Q_rp365JL~fn`gS@Yu==7{k?tsOK9(kUJpL z1e0&m!QGZ9ws4dU7=wP0n9dg-MxH{7#>^CZK-uRH`-vlllMmTolUgs?%sPROi~^3R z9(#d6MgoVt*M34zhPzgcnJ7L4Wjb#iL3Ih}-4RY1G7MZ{q%#iL3S6fXJ5Qe^DY17p zt*Dg>w!gI2uW(GTwO3ddQgrv zHZND@qoam{{&BGCr{cT8U-m^)(WCRsHqI*N8mc3p*Q{87fZ`KT?Nx(tInR6il~@Cj z(%#+1sG8cDKss=P5pmbEJJenj)ck4(!-9CphP79s(^dZixzR0n literal 0 HcmV?d00001 From fa124c85f023132a468c41796be1d145c52824b9 Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Wed, 30 Aug 2023 22:21:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.2.1=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../top/wherewego/base/ExampleInstrumentedTest.java | 2 +- app/src/main/AndroidManifest.xml | 10 +++++----- .../wherewego/{switchapp => vnt}/AddActivity.java | 8 ++++---- .../{switchapp => vnt}/ConnectActivity.java | 6 +++--- .../wherewego/{switchapp => vnt}/MainActivity.java | 13 +++++-------- .../wherewego/{switchapp => vnt}/MyVpnService.java | 8 ++++---- .../{switchapp => vnt}/action/ToastAction.java | 4 +--- .../{switchapp => vnt}/adapter/ConnectAdapter.java | 6 +++--- .../{switchapp => vnt}/adapter/StatusAdapter.java | 6 +++--- .../{switchapp => vnt}/app/AppActivity.java | 6 ++---- .../{switchapp => vnt}/app/AppAdapter.java | 2 +- .../{switchapp => vnt}/app/AppApplication.java | 8 ++++---- .../{switchapp => vnt}/app/AppFragment.java | 2 +- .../wherewego/{switchapp => vnt}/util/SPUtils.java | 2 +- .../widget/XCollapsingToolbarLayout.java | 2 +- app/src/main/res/layout/app_bar_main.xml | 6 +++--- app/src/main/res/values-night/themes.xml | 2 +- app/src/main/res/values/strings.xml | 4 ++-- app/src/main/res/values/themes.xml | 8 ++++---- settings.gradle | 2 +- 21 files changed, 51 insertions(+), 58 deletions(-) rename app/src/main/java/top/wherewego/{switchapp => vnt}/AddActivity.java (95%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/ConnectActivity.java (97%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/MainActivity.java (93%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/MyVpnService.java (97%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/action/ToastAction.java (85%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/adapter/ConnectAdapter.java (94%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/adapter/StatusAdapter.java (92%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/app/AppActivity.java (97%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/app/AppAdapter.java (99%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/app/AppApplication.java (98%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/app/AppFragment.java (97%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/util/SPUtils.java (98%) rename app/src/main/java/top/wherewego/{switchapp => vnt}/widget/XCollapsingToolbarLayout.java (98%) diff --git a/README.md b/README.md index fa0da03..764558d 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# VNTApp \ No newline at end of file +# VntApp \ No newline at end of file diff --git a/app/src/androidTest/java/top/wherewego/base/ExampleInstrumentedTest.java b/app/src/androidTest/java/top/wherewego/base/ExampleInstrumentedTest.java index 2792231..b7823b3 100644 --- a/app/src/androidTest/java/top/wherewego/base/ExampleInstrumentedTest.java +++ b/app/src/androidTest/java/top/wherewego/base/ExampleInstrumentedTest.java @@ -21,6 +21,6 @@ public class ExampleInstrumentedTest { public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - assertEquals("top.wherewego.switchapp", appContext.getPackageName()); + assertEquals("top.wherewego.vnt", appContext.getPackageName()); } } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9631153..ce2de86 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + package="top.wherewego.vnt"> @@ -13,7 +13,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.SwitchApp" + android:theme="@style/Theme.VntApp" tools:targetApi="31"> + android:theme="@style/Theme.VntApp.NoActionBar"> @@ -38,7 +38,7 @@ + android:theme="@style/Theme.VntApp.NoActionBar"> @@ -47,7 +47,7 @@ android:name=".MainActivity" android:exported="true" android:label="@string/app_name" - android:theme="@style/Theme.SwitchApp.NoActionBar"> + android:theme="@style/Theme.VntApp.NoActionBar"> diff --git a/app/src/main/java/top/wherewego/switchapp/AddActivity.java b/app/src/main/java/top/wherewego/vnt/AddActivity.java similarity index 95% rename from app/src/main/java/top/wherewego/switchapp/AddActivity.java rename to app/src/main/java/top/wherewego/vnt/AddActivity.java index eefd95a..4cf25bb 100644 --- a/app/src/main/java/top/wherewego/switchapp/AddActivity.java +++ b/app/src/main/java/top/wherewego/vnt/AddActivity.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp; +package top.wherewego.vnt; import android.widget.EditText; import android.widget.Spinner; @@ -10,9 +10,9 @@ import java.util.UUID; -import top.wherewego.switchapp.app.AppActivity; -import top.wherewego.switchapp.app.AppApplication; -import top.wherewego.switchapp.util.SPUtils; +import top.wherewego.vnt.app.AppActivity; +import top.wherewego.vnt.app.AppApplication; +import top.wherewego.vnt.util.SPUtils; import top.wherewego.vnt.jni.ConfigurationInfoBean; public class AddActivity extends AppActivity { diff --git a/app/src/main/java/top/wherewego/switchapp/ConnectActivity.java b/app/src/main/java/top/wherewego/vnt/ConnectActivity.java similarity index 97% rename from app/src/main/java/top/wherewego/switchapp/ConnectActivity.java rename to app/src/main/java/top/wherewego/vnt/ConnectActivity.java index 85353d6..da26c4b 100644 --- a/app/src/main/java/top/wherewego/switchapp/ConnectActivity.java +++ b/app/src/main/java/top/wherewego/vnt/ConnectActivity.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp; +package top.wherewego.vnt; import android.annotation.SuppressLint; import android.content.Intent; @@ -19,8 +19,8 @@ import java.util.List; import top.wherewego.base.BaseAdapter; -import top.wherewego.switchapp.adapter.ConnectAdapter; -import top.wherewego.switchapp.app.AppActivity; +import top.wherewego.vnt.adapter.ConnectAdapter; +import top.wherewego.vnt.app.AppActivity; import top.wherewego.vnt.jni.ConfigurationInfoBean; import top.wherewego.vnt.jni.DeviceBean; import top.wherewego.widget.layout.WrapRecyclerView; diff --git a/app/src/main/java/top/wherewego/switchapp/MainActivity.java b/app/src/main/java/top/wherewego/vnt/MainActivity.java similarity index 93% rename from app/src/main/java/top/wherewego/switchapp/MainActivity.java rename to app/src/main/java/top/wherewego/vnt/MainActivity.java index 981459d..fa24da5 100644 --- a/app/src/main/java/top/wherewego/switchapp/MainActivity.java +++ b/app/src/main/java/top/wherewego/vnt/MainActivity.java @@ -1,10 +1,7 @@ -package top.wherewego.switchapp; +package top.wherewego.vnt; -import android.content.DialogInterface; import android.content.Intent; -import android.util.Log; import android.view.View; -import android.widget.Toast; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; @@ -12,7 +9,6 @@ import androidx.appcompat.app.AlertDialog; import androidx.recyclerview.widget.RecyclerView; -import com.google.gson.Gson; import com.hjq.bar.OnTitleBarListener; import com.hjq.bar.TitleBar; import com.scwang.smart.refresh.layout.SmartRefreshLayout; @@ -20,9 +16,10 @@ import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener; import top.wherewego.base.BaseAdapter; -import top.wherewego.switchapp.adapter.StatusAdapter; -import top.wherewego.switchapp.app.AppActivity; -import top.wherewego.switchapp.app.AppApplication; +import top.wherewego.vnt.adapter.StatusAdapter; +import top.wherewego.vnt.app.AppActivity; +import top.wherewego.vnt.app.AppApplication; +import top.wherewego.vnt.util.SPUtils; import top.wherewego.vnt.jni.ConfigurationInfoBean; import top.wherewego.widget.layout.WrapRecyclerView; diff --git a/app/src/main/java/top/wherewego/switchapp/MyVpnService.java b/app/src/main/java/top/wherewego/vnt/MyVpnService.java similarity index 97% rename from app/src/main/java/top/wherewego/switchapp/MyVpnService.java rename to app/src/main/java/top/wherewego/vnt/MyVpnService.java index 627643d..cb85f4b 100644 --- a/app/src/main/java/top/wherewego/switchapp/MyVpnService.java +++ b/app/src/main/java/top/wherewego/vnt/MyVpnService.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp; +package top.wherewego.vnt; import android.content.Intent; import android.content.IntentFilter; @@ -77,7 +77,7 @@ public synchronized int onStartCommand(Intent intent, int flags, int startId) { boolean isTcp = intent.getBooleanExtra("isTcp", false); config = new Config(token, name, deviceId, server, stunServer, password.isEmpty() ? null : password, cipherModel, isTcp); if (mThread == null) { - mThread = new Thread(this, "SwitchVPN"); + mThread = new Thread(this, "VntVPN"); mThread.start(); } break; @@ -106,7 +106,7 @@ public void run() { } Handler handler = new Handler(Looper.getMainLooper()); handler.post(() -> { - Toast.makeText(getApplicationContext(), "Switch已停止", Toast.LENGTH_LONG).show(); + Toast.makeText(getApplicationContext(), "Vnt已停止", Toast.LENGTH_LONG).show(); }); stop0(); eVnt = null; @@ -182,7 +182,7 @@ private void run0() { Builder builder = new Builder(); int prefixLength = IpUtils.subnetMaskToPrefixLength(connect.getVirtualNetmask()); String ipRoute = IpUtils.intToIpAddress(connect.getVirtualGateway() & connect.getVirtualNetmask()); - builder.setSession("SwitchVPN") + builder.setSession("VntVPN") .setBlocking(true) .setMtu(1420) .addAddress(ip, prefixLength) diff --git a/app/src/main/java/top/wherewego/switchapp/action/ToastAction.java b/app/src/main/java/top/wherewego/vnt/action/ToastAction.java similarity index 85% rename from app/src/main/java/top/wherewego/switchapp/action/ToastAction.java rename to app/src/main/java/top/wherewego/vnt/action/ToastAction.java index f40ae63..1b5e0fa 100644 --- a/app/src/main/java/top/wherewego/switchapp/action/ToastAction.java +++ b/app/src/main/java/top/wherewego/vnt/action/ToastAction.java @@ -1,6 +1,4 @@ -package top.wherewego.switchapp.action; - -import androidx.annotation.StringRes; +package top.wherewego.vnt.action; /** diff --git a/app/src/main/java/top/wherewego/switchapp/adapter/ConnectAdapter.java b/app/src/main/java/top/wherewego/vnt/adapter/ConnectAdapter.java similarity index 94% rename from app/src/main/java/top/wherewego/switchapp/adapter/ConnectAdapter.java rename to app/src/main/java/top/wherewego/vnt/adapter/ConnectAdapter.java index d693b70..02dd73e 100644 --- a/app/src/main/java/top/wherewego/switchapp/adapter/ConnectAdapter.java +++ b/app/src/main/java/top/wherewego/vnt/adapter/ConnectAdapter.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.adapter; +package top.wherewego.vnt.adapter; import android.content.Context; import android.view.ViewGroup; @@ -6,8 +6,8 @@ import androidx.annotation.NonNull; -import top.wherewego.switchapp.R; -import top.wherewego.switchapp.app.AppAdapter; +import top.wherewego.vnt.R; +import top.wherewego.vnt.app.AppAdapter; import top.wherewego.vnt.jni.DeviceBean; public final class ConnectAdapter extends AppAdapter { diff --git a/app/src/main/java/top/wherewego/switchapp/adapter/StatusAdapter.java b/app/src/main/java/top/wherewego/vnt/adapter/StatusAdapter.java similarity index 92% rename from app/src/main/java/top/wherewego/switchapp/adapter/StatusAdapter.java rename to app/src/main/java/top/wherewego/vnt/adapter/StatusAdapter.java index e23f938..e5f8830 100644 --- a/app/src/main/java/top/wherewego/switchapp/adapter/StatusAdapter.java +++ b/app/src/main/java/top/wherewego/vnt/adapter/StatusAdapter.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.adapter; +package top.wherewego.vnt.adapter; import android.content.Context; import android.view.ViewGroup; @@ -6,8 +6,8 @@ import androidx.annotation.NonNull; -import top.wherewego.switchapp.R; -import top.wherewego.switchapp.app.AppAdapter; +import top.wherewego.vnt.R; +import top.wherewego.vnt.app.AppAdapter; import top.wherewego.vnt.jni.ConfigurationInfoBean; /** diff --git a/app/src/main/java/top/wherewego/switchapp/app/AppActivity.java b/app/src/main/java/top/wherewego/vnt/app/AppActivity.java similarity index 97% rename from app/src/main/java/top/wherewego/switchapp/app/AppActivity.java rename to app/src/main/java/top/wherewego/vnt/app/AppActivity.java index cc67ed6..37b82b2 100644 --- a/app/src/main/java/top/wherewego/switchapp/app/AppActivity.java +++ b/app/src/main/java/top/wherewego/vnt/app/AppActivity.java @@ -1,10 +1,8 @@ -package top.wherewego.switchapp.app; +package top.wherewego.vnt.app; import android.content.Intent; import android.os.Bundle; -import android.view.View; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -12,7 +10,7 @@ import com.hjq.bar.TitleBar; import top.wherewego.base.BaseActivity; import top.wherewego.base.BaseDialog; -import top.wherewego.switchapp.R; +import top.wherewego.vnt.R; /** diff --git a/app/src/main/java/top/wherewego/switchapp/app/AppAdapter.java b/app/src/main/java/top/wherewego/vnt/app/AppAdapter.java similarity index 99% rename from app/src/main/java/top/wherewego/switchapp/app/AppAdapter.java rename to app/src/main/java/top/wherewego/vnt/app/AppAdapter.java index b99cb06..832eb69 100644 --- a/app/src/main/java/top/wherewego/switchapp/app/AppAdapter.java +++ b/app/src/main/java/top/wherewego/vnt/app/AppAdapter.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.app; +package top.wherewego.vnt.app; import android.content.Context; import android.view.View; diff --git a/app/src/main/java/top/wherewego/switchapp/app/AppApplication.java b/app/src/main/java/top/wherewego/vnt/app/AppApplication.java similarity index 98% rename from app/src/main/java/top/wherewego/switchapp/app/AppApplication.java rename to app/src/main/java/top/wherewego/vnt/app/AppApplication.java index 46d615b..f7bf45f 100644 --- a/app/src/main/java/top/wherewego/switchapp/app/AppApplication.java +++ b/app/src/main/java/top/wherewego/vnt/app/AppApplication.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.app; +package top.wherewego.vnt.app; import android.app.Application; import android.content.Context; @@ -13,8 +13,8 @@ import java.util.ArrayList; -import top.wherewego.switchapp.R; -import top.wherewego.switchapp.util.SPUtils; +import top.wherewego.vnt.R; +import top.wherewego.vnt.util.SPUtils; import top.wherewego.vnt.jni.ConfigurationInfoBean; /** @@ -45,7 +45,7 @@ protected void attachBaseContext(Context base) { Log.d("swichapp", "attachBaseContext: s : " + s); String json = SPUtils.getString(this, s, "0"); if (json.equals("0")) { - return; + continue; } ConfigurationInfoBean configurationInfoBean = new Gson().fromJson(json, ConfigurationInfoBean.class); configList.add(configurationInfoBean); diff --git a/app/src/main/java/top/wherewego/switchapp/app/AppFragment.java b/app/src/main/java/top/wherewego/vnt/app/AppFragment.java similarity index 97% rename from app/src/main/java/top/wherewego/switchapp/app/AppFragment.java rename to app/src/main/java/top/wherewego/vnt/app/AppFragment.java index 938f630..14439bc 100644 --- a/app/src/main/java/top/wherewego/switchapp/app/AppFragment.java +++ b/app/src/main/java/top/wherewego/vnt/app/AppFragment.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.app; +package top.wherewego.vnt.app; import top.wherewego.base.BaseFragment; diff --git a/app/src/main/java/top/wherewego/switchapp/util/SPUtils.java b/app/src/main/java/top/wherewego/vnt/util/SPUtils.java similarity index 98% rename from app/src/main/java/top/wherewego/switchapp/util/SPUtils.java rename to app/src/main/java/top/wherewego/vnt/util/SPUtils.java index 041f5d8..9d74e43 100644 --- a/app/src/main/java/top/wherewego/switchapp/util/SPUtils.java +++ b/app/src/main/java/top/wherewego/vnt/util/SPUtils.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.util; +package top.wherewego.vnt.util; import android.content.Context; import android.content.SharedPreferences; diff --git a/app/src/main/java/top/wherewego/switchapp/widget/XCollapsingToolbarLayout.java b/app/src/main/java/top/wherewego/vnt/widget/XCollapsingToolbarLayout.java similarity index 98% rename from app/src/main/java/top/wherewego/switchapp/widget/XCollapsingToolbarLayout.java rename to app/src/main/java/top/wherewego/vnt/widget/XCollapsingToolbarLayout.java index d6ef8a8..c1694c2 100644 --- a/app/src/main/java/top/wherewego/switchapp/widget/XCollapsingToolbarLayout.java +++ b/app/src/main/java/top/wherewego/vnt/widget/XCollapsingToolbarLayout.java @@ -1,4 +1,4 @@ -package top.wherewego.switchapp.widget; +package top.wherewego.vnt.widget; import android.content.Context; import android.util.AttributeSet; diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 3773d8a..81c3882 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -4,19 +4,19 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".MainActivity"> + tools:context="top.wherewego.vnt.MainActivity"> + android:theme="@style/Theme.VntApp.AppBarOverlay"> + app:popupTheme="@style/Theme.VntApp.PopupOverlay" /> diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 9a2e435..0d4b51b 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,6 +1,6 @@ - - -