From: TrillGates Date: Wed, 23 Jun 2021 09:57:54 +0000 (+0800) Subject: adjust icon X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=615a345ca65aaa479e2097c8bdcdb5ddc14c5206;p=iclooplauncher.git adjust icon --- diff --git a/app/release/ICLoopPageLauncher_V11_202106221654_release.apk b/app/release/ICLoopPageLauncher_V13_202106231708_release.apk similarity index 55% rename from app/release/ICLoopPageLauncher_V11_202106221654_release.apk rename to app/release/ICLoopPageLauncher_V13_202106231708_release.apk index af0403c..123a63b 100644 Binary files a/app/release/ICLoopPageLauncher_V11_202106221654_release.apk and b/app/release/ICLoopPageLauncher_V13_202106231708_release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 1163ef7..a69e194 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -12,7 +12,7 @@ "filters": [], "versionCode": 1, "versionName": "1.0", - "outputFile": "ICLoopPageLauncher_V11_202106221654_release.apk" + "outputFile": "ICLoopPageLauncher_V13_202106231708_release.apk" } ] } \ No newline at end of file diff --git a/app/src/main/java/com/ic/launcher/MainActivity.java b/app/src/main/java/com/ic/launcher/MainActivity.java index 3f62067..b280afb 100644 --- a/app/src/main/java/com/ic/launcher/MainActivity.java +++ b/app/src/main/java/com/ic/launcher/MainActivity.java @@ -1,6 +1,5 @@ package com.ic.launcher; -import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; @@ -55,22 +54,13 @@ public class MainActivity extends AppCompatActivity { int packageNameResId = item.getPackageNameResId(); String packageName = getString(packageNameResId); if (!TextUtils.isEmpty(packageName)) { - //APN独立处理 - if (packageName.equals(getString(R.string.app_package_name_apn))) { - Intent apnIntent = new Intent(); - ComponentName apnComponent = new ComponentName("com.android.settings", - "com.android.settings.ApnSettings"); - apnIntent.setComponent(apnComponent); - startActivity(apnIntent); + Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(packageName); + if (launchIntentForPackage != null) { + launchIntentForPackage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivity(launchIntentForPackage); } else { - Intent launchIntentForPackage = getPackageManager().getLaunchIntentForPackage(packageName); - if (launchIntentForPackage != null) { - launchIntentForPackage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(launchIntentForPackage); - } else { - Toast.makeText(this, getString(R.string.no_application_tips_text), - Toast.LENGTH_SHORT).show(); - } + Toast.makeText(this, getString(R.string.no_application_tips_text), + Toast.LENGTH_SHORT).show(); } } }); diff --git a/app/src/main/java/com/ic/launcher/presenter/StatusBarBasePresenter.java b/app/src/main/java/com/ic/launcher/presenter/StatusBarBasePresenter.java index 667e81a..3b050a4 100644 --- a/app/src/main/java/com/ic/launcher/presenter/StatusBarBasePresenter.java +++ b/app/src/main/java/com/ic/launcher/presenter/StatusBarBasePresenter.java @@ -29,6 +29,8 @@ public class StatusBarBasePresenter extends BasePresenter { public MutableLiveData batteryLev = new MutableLiveData<>(); //信号强度 public MutableLiveData signalLev = new MutableLiveData<>(); + //是否有sim卡 + public MutableLiveData hasSimCardValue = new MutableLiveData<>(); //连接状态 public MutableLiveData isServerConnected = new MutableLiveData<>(); //网络类型 @@ -113,10 +115,10 @@ public class StatusBarBasePresenter extends BasePresenter { //判断卡的状态 if (querySimCardState()) { getSignalStrength(); - getConnectionState(); queryPhoneNetworkTypeResId(mTelephony); } - handler.postDelayed(this, 1000); + getConnectionState(); + handler.postDelayed(this, 3000); } }); } @@ -136,25 +138,20 @@ public class StatusBarBasePresenter extends BasePresenter { return true; } - boolean flag = false; + boolean flag; mOldSimCardState = simState; switch (simState) { case TelephonyManager.SIM_STATE_READY: //sim卡准备好了 flag = true; - break; - case TelephonyManager.SIM_STATE_NETWORK_LOCKED: - case TelephonyManager.SIM_STATE_PUK_REQUIRED: - case TelephonyManager.SIM_STATE_PIN_REQUIRED: - //sim卡网络查找中 - break; + break;//sim卡网络查找中 default: //sim卡没有/准备好 - //TODO: + flag = false; break; } - + hasSimCardValue.postValue(flag); return flag; } @@ -189,7 +186,12 @@ public class StatusBarBasePresenter extends BasePresenter { //获取链接状态 private void getConnectionState() { - boolean connected = SystemUtils.getSystemPropertiesBoolean("persist.sys.server_connected", false); + boolean connected = SystemUtils.getSystemPropertiesBoolean("persist.sys.server_connected", + false); + Boolean value = isServerConnected.getValue(); + if (value != null && connected == value) { + return; + } isServerConnected.postValue(connected); } diff --git a/app/src/main/java/com/ic/launcher/view/BatteryView.java b/app/src/main/java/com/ic/launcher/view/BatteryView.java index b660bf5..79d591d 100644 --- a/app/src/main/java/com/ic/launcher/view/BatteryView.java +++ b/app/src/main/java/com/ic/launcher/view/BatteryView.java @@ -40,7 +40,8 @@ public class BatteryView extends View { paint.setFlags(Paint.ANTI_ALIAS_FLAG); options = new BitmapFactory.Options(); options.inScaled = false; - Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.battery_level_save_100, options); + Bitmap bitmap = BitmapFactory.decodeResource(getResources(), + R.mipmap.battery_level_save_100, options); picWidth = bitmap.getWidth(); picHeight = bitmap.getHeight(); //加载静态图片列表 diff --git a/app/src/main/java/com/ic/launcher/view/SignalView.java b/app/src/main/java/com/ic/launcher/view/SignalView.java index 0b605d3..7d9dbd6 100644 --- a/app/src/main/java/com/ic/launcher/view/SignalView.java +++ b/app/src/main/java/com/ic/launcher/view/SignalView.java @@ -20,7 +20,7 @@ import com.ic.launcher.R; public class SignalView extends View { - private Bitmap defaultSgnalPic; + private Bitmap defaultSignalPic; public String showText = ""; private int totalWidth; @@ -51,9 +51,9 @@ public class SignalView extends View { textPaint.setColor(Color.WHITE); textPaint.setTextSize(type_size); textPaint.setTypeface(Typeface.DEFAULT_BOLD); - defaultSgnalPic = BitmapFactory.decodeResource(getResources(), R.mipmap.top_signal_0, options); - targetHeight = defaultSgnalPic.getHeight(); - width = defaultSgnalPic.getWidth(); + defaultSignalPic = BitmapFactory.decodeResource(getResources(), R.mipmap.top_signal_0, options); + targetHeight = defaultSignalPic.getHeight(); + width = defaultSignalPic.getWidth(); retestSize(); //绘制图片的画笔 picPaint = new Paint(); @@ -94,17 +94,6 @@ public class SignalView extends View { private boolean isNoNetwork = false; - //没有网络 - public void noNetwork() { - isNoNetwork = true; - //显示图片图标 - this.currentPic = R.mipmap.top_no_sim_card; - //清空文字 - this.showText = getContext().getString(R.string.no_sim_car); - retestSize(); - updateBitMap(); - invalidate(); - } private void updateBitMap() { bitmap = BitmapFactory.decodeResource(getResources(), currentPic, options); @@ -178,4 +167,28 @@ public class SignalView extends View { } } } + + private boolean hasSimCard = false; + + /** + * 更新是否有sim卡 + * + * @param hasSimCard + */ + public void updateSimCardState(Boolean hasSimCard) { + if (hasSimCard == null || !hasSimCard) { + //没有sim card + this.hasSimCard = false; + //如果没有sim卡,显示没有sim卡的图标 + //显示图片图标 + this.currentPic = R.mipmap.top_no_sim_card; + //清空文字 + this.showText = getContext().getString(R.string.no_sim_car); + retestSize(); + updateBitMap(); + invalidate(); + } else { + this.hasSimCard = true; + } + } } diff --git a/app/src/main/java/com/ic/launcher/view/StatusBarView.java b/app/src/main/java/com/ic/launcher/view/StatusBarView.java index fc2f0f5..81e5192 100644 --- a/app/src/main/java/com/ic/launcher/view/StatusBarView.java +++ b/app/src/main/java/com/ic/launcher/view/StatusBarView.java @@ -12,6 +12,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.lifecycle.LifecycleOwner; +import com.ic.iclooger.ICLogger; import com.ic.launcher.R; import com.ic.launcher.presenter.StatusBarPresenter; @@ -120,7 +121,7 @@ public class StatusBarView extends FrameLayout { } }); statusBarPresenter.networkTypeValue.observe(lifecycleOwner, type -> { - // ICLogger.d("type == > " + type); + ICLogger.d("type == > " + type); if (TextUtils.isEmpty(type)) { signalView.noNetwork(); } else { @@ -128,7 +129,7 @@ public class StatusBarView extends FrameLayout { } }); statusBarPresenter.signalLev.observe(lifecycleOwner, lev -> { - //ICLogger.d("lev == > " + lev); + ICLogger.d("lev == > " + lev); //信号强度 if (lev == null) { signalView.updateLev(0); @@ -136,14 +137,24 @@ public class StatusBarView extends FrameLayout { signalView.updateLev(lev); } }); + statusBarPresenter.hasSimCardValue.observe(lifecycleOwner, hasSimCard -> { + ICLogger.d("hasSimCard == > " + hasSimCard); + signalView.updateSimCardState(hasSimCard); + }); statusBarPresenter.isChargingValue.observe(lifecycleOwner, isCharging -> { //是否在充电 + ICLogger.d("isCharging == > " + isCharging); //如果电量不是100%,那么就进行播放充电动画 batteryView.charging(isCharging); }); statusBarPresenter.isServerConnected.observe(lifecycleOwner, isConnected -> { //是否已经链接到服务器 - connectedView.setVisibility(isConnected ? VISIBLE : GONE); + ICLogger.d("isConnected == > " + isConnected); + if (isConnected == Boolean.TRUE) { + connectedView.setVisibility(VISIBLE); + } else { + connectedView.setVisibility(GONE); + } }); } } diff --git a/app/src/main/res/layout/item_status_bar.xml b/app/src/main/res/layout/item_status_bar.xml index 29cf7ae..8524c06 100644 --- a/app/src/main/res/layout/item_status_bar.xml +++ b/app/src/main/res/layout/item_status_bar.xml @@ -16,6 +16,7 @@ android:id="@+id/mar_queue_view" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginLeft="10dp" android:layout_marginRight="90dp" android:layout_toRightOf="@id/signal_view"> diff --git a/app/src/main/res/mipmap-mdpi/top_icon_connected.png b/app/src/main/res/mipmap-mdpi/top_icon_connected.png index b5e30cf..f33be47 100644 Binary files a/app/src/main/res/mipmap-mdpi/top_icon_connected.png and b/app/src/main/res/mipmap-mdpi/top_icon_connected.png differ diff --git a/app/src/main/res/mipmap-mdpi/top_icon_wifi.png b/app/src/main/res/mipmap-mdpi/top_icon_wifi.png index 9f09b01..445b65e 100644 Binary files a/app/src/main/res/mipmap-mdpi/top_icon_wifi.png and b/app/src/main/res/mipmap-mdpi/top_icon_wifi.png differ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d88f907..12081cf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,15 +25,14 @@ com.ic.dial com.ic.icwetalk com.ic.iccontact - com.eqc.camera + com.ic.camera com.eqc.gallery com.ic.sms com.ic.record com.ic.sign - com.eqc.settings - com.ic.apn - 未找到相关应用. + com.ic.settings + 未找到相关应用. 星期一 星期二 星期三 diff --git a/app/version_code.properties b/app/version_code.properties index 4599820..956160e 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Tue Jun 22 16:54:08 CST 2021 -VERSION_CODE=11 +#Wed Jun 23 17:08:39 CST 2021 +VERSION_CODE=13