Commit ca60633c authored by kenan's avatar kenan

dialog

parent f3a145f3
......@@ -64,10 +64,15 @@ public class LogoActivity extends BaseActivity {
}
private void startLoad() {
if(ly_loading.getVisibility() == View.VISIBLE){
return;
}
ly_loading.setVisibility(View.VISIBLE);
int vercode = SystemUtils.getVersion(this);
boolean isNewVersion;
if (AppsSettings.get().getAppVersion() < vercode) {
int oldVer = AppsSettings.get().getAppVersion();
Log.i("ygomobile", "check version old=" + oldVer + ", new=" + vercode);
if (oldVer < vercode) {
AppsSettings.get().setAppVersion(vercode);
isNewVersion = true;
} else {
......@@ -75,7 +80,6 @@ public class LogoActivity extends BaseActivity {
}
ResCheckTask resCheckTask = new ResCheckTask(this, isNewVersion, 1000);
number_progress_bar.setMax(100);
long time = System.currentTimeMillis();
VUiKit.defer()
.when(resCheckTask)
.progress((str) -> {
......
......@@ -9,6 +9,8 @@ import android.view.Display;
import java.lang.reflect.Method;
import cn.garymb.ygomobile.lite.BuildConfig;
public class SystemUtils {
public static String getVersionName(Context context) {
PackageInfo packageInfo = null;
......@@ -23,15 +25,15 @@ public class SystemUtils {
}
public static int getVersion(Context context) {
PackageInfo packageInfo = null;
try {
packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
}
if (packageInfo != null) {
return packageInfo.versionCode;
}
return 0;
// PackageInfo packageInfo = null;
// try {
// packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
// } catch (PackageManager.NameNotFoundException e) {
// }
// if (packageInfo != null) {
// return packageInfo.versionCode;
// }
return BuildConfig.VERSION_CODE;
}
public static DisplayMetrics getHasVirtualDisplayMetrics(Activity context) {
......
......@@ -43,7 +43,8 @@
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_marginBottom="5dp"
android:minWidth="200dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment