|
8 | 8 | import android.content.Context; |
9 | 9 | import android.content.Intent; |
10 | 10 | import android.content.SharedPreferences; |
11 | | -import android.graphics.Color; |
12 | 11 | import android.graphics.drawable.BitmapDrawable; |
13 | 12 | import android.graphics.drawable.Drawable; |
14 | 13 | import android.net.Uri; |
|
21 | 20 | import android.provider.Settings; |
22 | 21 | import android.text.TextUtils; |
23 | 22 | import android.util.Log; |
24 | | -import android.util.TypedValue; |
25 | 23 | import android.view.KeyEvent; |
26 | 24 | import android.view.View; |
27 | 25 | import android.view.Window; |
28 | 26 | import android.view.WindowManager; |
29 | | -import android.widget.CheckBox; |
30 | | -import android.widget.LinearLayout; |
31 | | -import android.widget.TextView; |
32 | 27 | import android.widget.Toast; |
33 | 28 |
|
34 | 29 | import com.android.launcher3.LauncherFiles; |
|
50 | 45 | import io.virtualapp.abs.ui.VUiKit; |
51 | 46 | import io.virtualapp.settings.SettingsActivity; |
52 | 47 | import io.virtualapp.update.VAVersionService; |
53 | | -import io.virtualapp.utils.Misc; |
54 | 48 |
|
55 | 49 | import static io.virtualapp.XApp.XPOSED_INSTALLER_PACKAGE; |
56 | 50 |
|
@@ -84,7 +78,6 @@ public void onCreate(Bundle savedInstanceState) { |
84 | 78 | alertForMeizu(); |
85 | 79 | alertForDoze(); |
86 | 80 | mDirectlyBack = sharedPreferences.getBoolean(SettingsActivity.DIRECTLY_BACK_KEY, false); |
87 | | - alertForExp(); |
88 | 81 | } |
89 | 82 |
|
90 | 83 | private void installXposed() { |
@@ -261,61 +254,6 @@ private void alertForMeizu() { |
261 | 254 | }, 2000); |
262 | 255 | } |
263 | 256 |
|
264 | | - protected int dp2px(float dp) { |
265 | | - final float scale = getResources().getDisplayMetrics().density; |
266 | | - return (int) (dp * scale + 0.5f); |
267 | | - } |
268 | | - |
269 | | - private void alertForExp() { |
270 | | - final String shown = "_exp_has_alert3"; |
271 | | - boolean aBoolean = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(shown, false); |
272 | | - if (aBoolean) { |
273 | | - return; |
274 | | - } |
275 | | - |
276 | | - LinearLayout layout = new LinearLayout(this); |
277 | | - layout.setOrientation(LinearLayout.VERTICAL); |
278 | | - |
279 | | - int _20dp = dp2px(20); |
280 | | - layout.setPadding(_20dp, _20dp, _20dp, _20dp); |
281 | | - |
282 | | - TextView tv = new TextView(this); |
283 | | - tv.setTextColor(Color.BLACK); |
284 | | - tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); |
285 | | - tv.setText(R.string.exp_tips); |
286 | | - layout.addView(tv); |
287 | | - |
288 | | - CheckBox checkBox = new CheckBox(this); |
289 | | - checkBox.setText("不再提示"); |
290 | | - checkBox.setOnClickListener(v -> { |
291 | | - if (checkBox.isChecked()) { |
292 | | - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean(shown, true).apply(); |
293 | | - } |
294 | | - }); |
295 | | - |
296 | | - layout.addView(checkBox); |
297 | | - mUiHandler.postDelayed(() -> { |
298 | | - AlertDialog alertDialog = new AlertDialog.Builder(getContext()) |
299 | | - .setTitle(R.string.exp_introduce_title) |
300 | | - .setView(layout) |
301 | | - .setPositiveButton(R.string.exp_introduce_install, (dialog, which) -> { |
302 | | - Intent t = new Intent(Intent.ACTION_VIEW); |
303 | | - t.setData(Uri.parse("https://www.coolapk.com/apk/me.weishu.exp")); |
304 | | - try { |
305 | | - startActivity(t); |
306 | | - } catch (Throwable ignored) { |
307 | | - } |
308 | | - }).setNegativeButton(R.string.about_donate_title, (dialog, which) -> { |
309 | | - Misc.showDonate(NewHomeActivity.this); |
310 | | - }) |
311 | | - .create(); |
312 | | - try { |
313 | | - alertDialog.show(); |
314 | | - } catch (Throwable ignored) { |
315 | | - } |
316 | | - }, 2000); |
317 | | - } |
318 | | - |
319 | 257 | private void alertForDoze() { |
320 | 258 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { |
321 | 259 | return; |
|
0 commit comments