mirror of
https://github.com/Tencent/QMUI_Android.git
synced 2026-10-29 03:26:44 +08:00
release to 2.0.0-alpha01
This commit is contained in:
+2
-2
@@ -22,8 +22,8 @@ android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
||||
GROUP=com.qmuiteam
|
||||
QMUI_VERSION=1.4.3
|
||||
QMUI_ARCH_VERSION=0.6.2
|
||||
QMUI_VERSION=2.0.0-alpha01
|
||||
QMUI_ARCH_VERSION=2.0.0-alpha01
|
||||
QMUI_LINT_VERSION = 1.1.0
|
||||
QMUI_SKIN_MAKER_VERSION = 0.0.1
|
||||
POM_GIT_URL=https://github.com/Tencent/QMUI_Android/
|
||||
|
||||
@@ -46,7 +46,7 @@ android {
|
||||
minSdkVersion parent.ext.minSdkVersion
|
||||
targetSdkVersion parent.ext.targetSdkVersion
|
||||
versionCode gitVersion
|
||||
versionName "1.4.0"
|
||||
versionName QMUI_VERSION
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
|
||||
@@ -63,17 +63,12 @@ public class QDApplication extends Application {
|
||||
QMUISkinMaker.init(context,
|
||||
new String[]{"com.qmuiteam.qmuidemo"},
|
||||
new String[]{"app_skin_"}, R.attr.class);
|
||||
updateSkin(getResources().getConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
updateSkin(newConfig);
|
||||
}
|
||||
|
||||
private void updateSkin(@NonNull Configuration config){
|
||||
if((config.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES){
|
||||
if((newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES){
|
||||
QDSkinManager.changeSkin(QDSkinManager.SKIN_DARK);
|
||||
}else if(QDSkinManager.getCurrentSkin() == QDSkinManager.SKIN_DARK){
|
||||
QDSkinManager.changeSkin(QDSkinManager.SKIN_BLUE);
|
||||
|
||||
@@ -151,8 +151,8 @@ public class QDMainActivity extends BaseFragmentActivity {
|
||||
|
||||
private void showGlobalActionPopup(View v){
|
||||
String[] listItems = new String[]{
|
||||
"Change Theme",
|
||||
QDApplication.openSkinMake ? "Close SkinMaker" : "Open SkinMaker",
|
||||
"Change Skin",
|
||||
QDApplication.openSkinMake ? "Close SkinMaker(Developing)" : "Open SkinMaker(Developing)",
|
||||
"Export SkinMaker Result"
|
||||
};
|
||||
List<String> data = new ArrayList<>();
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
package com.qmuiteam.qmuidemo.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.util.Log;
|
||||
|
||||
import com.qmuiteam.qmui.skin.QMUISkinManager;
|
||||
import com.qmuiteam.qmuidemo.QDApplication;
|
||||
@@ -32,7 +34,16 @@ public class QDSkinManager {
|
||||
skinManager.addSkin(SKIN_BLUE, R.style.app_skin_blue);
|
||||
skinManager.addSkin(SKIN_DARK, R.style.app_skin_dark);
|
||||
skinManager.addSkin(SKIN_WHITE, R.style.app_skin_white);
|
||||
skinManager.changeSkin(QDPreferenceManager.getInstance(context).getSkinIndex());
|
||||
boolean isDarkMode = (context.getResources().getConfiguration().uiMode
|
||||
& Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
|
||||
int storeSkinIndex = QDPreferenceManager.getInstance(context).getSkinIndex();
|
||||
if (isDarkMode && storeSkinIndex != SKIN_DARK) {
|
||||
skinManager.changeSkin(SKIN_DARK);
|
||||
} else if (!isDarkMode && storeSkinIndex == SKIN_DARK) {
|
||||
skinManager.changeSkin(SKIN_BLUE);
|
||||
}else{
|
||||
skinManager.changeSkin(storeSkinIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void changeSkin(int index) {
|
||||
@@ -40,7 +51,7 @@ public class QDSkinManager {
|
||||
QDPreferenceManager.getInstance(QDApplication.getContext()).setSkinIndex(index);
|
||||
}
|
||||
|
||||
public static int getCurrentSkin(){
|
||||
public static int getCurrentSkin() {
|
||||
return QMUISkinManager.defaultInstance(QDApplication.getContext()).getCurrentSkin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import android.content.Context;
|
||||
*/
|
||||
|
||||
public class QDUpgradeManager {
|
||||
public static final int INVALIDATE_VERSION_CODE = -1;
|
||||
public static final int INVALIDATE_VERSION_CODE = 0;
|
||||
|
||||
public static final int VERSION_1_1_0 = 110;
|
||||
public static final int VERSION_1_1_1 = 111;
|
||||
@@ -42,7 +42,8 @@ public class QDUpgradeManager {
|
||||
public static final int VERSION_1_2_0 = 120;
|
||||
public static final int VERSION_1_3_1 = 131;
|
||||
public static final int VERSION_1_4_0 = 140;
|
||||
private static final int sCurrentVersion = VERSION_1_4_0;
|
||||
public static final int VERSION_2_0_0_alpha0 = -2000;
|
||||
private static final int sCurrentVersion = VERSION_2_0_0_alpha0;
|
||||
private static QDUpgradeManager sQDUpgradeManager = null;
|
||||
private UpgradeTipTask mUpgradeTipTask;
|
||||
|
||||
@@ -62,7 +63,19 @@ public class QDUpgradeManager {
|
||||
public void check() {
|
||||
int oldVersion = QDPreferenceManager.getInstance(mContext).getVersionCode();
|
||||
int currentVersion = sCurrentVersion;
|
||||
if (currentVersion > oldVersion) {
|
||||
boolean versionUpdated = false;
|
||||
if(currentVersion != oldVersion){
|
||||
if(currentVersion < 0){
|
||||
// alpha release
|
||||
if(-currentVersion > oldVersion){
|
||||
versionUpdated = true;
|
||||
}
|
||||
}else if (currentVersion > oldVersion) {
|
||||
versionUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(versionUpdated){
|
||||
if (oldVersion == INVALIDATE_VERSION_CODE) {
|
||||
onNewInstall(currentVersion);
|
||||
} else {
|
||||
|
||||
@@ -68,7 +68,12 @@ public class UpgradeTipTask implements UpgradeTask {
|
||||
|
||||
public CharSequence getUpgradeWord(final Activity activity) {
|
||||
SpannableStringBuilder text = new SpannableStringBuilder();
|
||||
if(mNewVersion == QDUpgradeManager.VERSION_1_4_0){
|
||||
if(mNewVersion == QDUpgradeManager.VERSION_2_0_0_alpha0){
|
||||
text.append("1. Migrated the library to Androidx.\n");
|
||||
text.append("2. Provided dark mode(skin) support. Almost all widgets are covered.\n");
|
||||
text.append("3. Refactor some widget such as QMUIPopup, QMUITabSegment. Provided more function.\n");
|
||||
text.append("4. Provided some simple kotlin methods.");
|
||||
}else if(mNewVersion == QDUpgradeManager.VERSION_1_4_0){
|
||||
text.append("1. Updated arch library to 0.6.0. Provide annotation MaybeFirstIn and DefaultFirstFragment.\n");
|
||||
text.append("2. Updated lint library to 1.1.0 to Support Android Studio 3.4+.\n");
|
||||
text.append("3. Replaced parent theme of QMUI.Compat with Theme.AppCompat.DayNight.\n");
|
||||
|
||||
Reference in New Issue
Block a user