diff --git a/app/build.gradle b/app/build.gradle index fe05d45..487864b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' apply plugin: "com.tencent.android.tpns" def appName() { - return "科大讯飞学习桌面" + return "ZYLauncher" } def releaseTime() { @@ -74,9 +74,6 @@ android { } } } - manifestPlaceholders = [ - Baidu_AK: "ZauKWLbO0AfHSgR2j3unMkP0MwbBZHxO" - ] } release { @@ -101,9 +98,6 @@ android { } } } - manifestPlaceholders = [ - Baidu_AK: "ZauKWLbO0AfHSgR2j3unMkP0MwbBZHxO" - ] } } } @@ -123,7 +117,6 @@ dependencies { implementation "androidx.viewpager2:viewpager2:1.0.0" // Java language implementation implementation "androidx.fragment:fragment:1.4.1" - implementation "androidx.viewpager2:viewpager2:1.0.0" implementation 'androidx.legacy:legacy-support-v4:1.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.3' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 34f828c..26d5317 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,7 @@ + package="com.uiui.zyos"> @@ -102,11 +101,6 @@ - - \ No newline at end of file diff --git a/app/src/main/aidl/com/uiui/sn/IGetInfoInterface.aidl b/app/src/main/aidl/com/uiui/sn/IGetInfoInterface.aidl deleted file mode 100644 index 912a7db..0000000 --- a/app/src/main/aidl/com/uiui/sn/IGetInfoInterface.aidl +++ /dev/null @@ -1,31 +0,0 @@ -// IGetInfoInterface.aidl -package com.uiui.sn; - -// Declare any non-default types here with import statements - -interface IGetInfoInterface { - /** - * Demonstrates some basic types that you can use as parameters - * and return values in AIDL. - */ - void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, - double aDouble, String aString); - - //获取sn - String getSerial(); - //获取用户信息 - String getUserInfo(); - //获取隐藏APP - List getHideAPP(); - //获取禁止打开的APP - List getForbidAPP(); - - //获取app设置 - String getAppTimeControl(); - //获取整机设置 - String getSnTimeControl(); - //获取系统设置 - String getSetting(); - //获取定位结果 - String getMapResult(); -} diff --git a/app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl b/app/src/main/aidl/com/uiui/zysn/IGetInfoInterface.aidl similarity index 63% rename from app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl rename to app/src/main/aidl/com/uiui/zysn/IGetInfoInterface.aidl index 3d39497..6889663 100644 --- a/app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl +++ b/app/src/main/aidl/com/uiui/zysn/IGetInfoInterface.aidl @@ -1,14 +1,18 @@ -// IAlarmAidlInterface.aidl -package com.alarmclock.uiui; +// IGetInfoInterface.aidl +package com.uiui.zysn; // Declare any non-default types here with import statements -interface IAlarmAidlInterface { +interface IGetInfoInterface { /** * Demonstrates some basic types that you can use as parameters * and return values in AIDL. */ void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString); - String getAlarm(); + + //获取sn + String getSerial(); + //获取定位结果 + String getMapResult(); } diff --git a/app/src/main/java/com/uiui/zyos/activity/NoticeActivity.java b/app/src/main/java/com/uiui/zyos/activity/NoticeActivity.java deleted file mode 100644 index 3df3e5d..0000000 --- a/app/src/main/java/com/uiui/zyos/activity/NoticeActivity.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.uiui.zyos.activity; - -import android.content.Context; -import android.content.Intent; -import android.media.AudioManager; -import android.media.MediaPlayer; -import android.os.Bundle; -import android.os.PowerManager; -import android.os.Vibrator; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.widget.Button; -import android.widget.ImageView; -import android.widget.TextView; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.constraintlayout.widget.ConstraintLayout; - -import com.blankj.utilcode.util.FileUtils; -import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.bitmap.RoundedCorners; -import com.bumptech.glide.request.RequestOptions; -import com.uiui.zyos.R; -import com.uiui.zyos.alarm.AlarmUtils; -import com.uiui.zyos.bean.AlarmClockData; -import com.uiui.zyos.utils.FileUtil; -import com.uiui.zyos.utils.ScreenUtils; -import com.uiui.zyos.utils.Utils; -import com.uiui.zyos.utils.WakeUpUtils; -import com.uiui.zyos.view.JzvdStdAssert; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; - -import butterknife.BindView; -import butterknife.ButterKnife; -import cn.jzvd.JZDataSource; -import cn.jzvd.Jzvd; -import io.reactivex.rxjava3.annotations.NonNull; -import io.reactivex.rxjava3.core.Observer; -import io.reactivex.rxjava3.disposables.Disposable; - -public class NoticeActivity extends AppCompatActivity { - private String TAG = NoticeActivity.class.getSimpleName(); - - @BindView(R.id.tv_title) - TextView tv_title; - @BindView(R.id.bt_ok) - Button bt_ok; - @BindView(R.id.cl_voice) - ConstraintLayout cl_voice; - @BindView(R.id.cl_vp) - ConstraintLayout cl_vp; - @BindView(R.id.jz_video) - JzvdStdAssert jz_video; - @BindView(R.id.imageView) - ImageView imageView; - - private AlarmClockData alarmClockData; - private int code; - private MediaPlayer mediaPlayer; - private PowerManager pm; - private PowerManager.WakeLock wakeLock; - private AudioManager audioManager; - - private Vibrator vibrator; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_notice); - ButterKnife.bind(this); - Intent intent = getIntent(); - code = intent.getIntExtra("id", -1); - pm = (PowerManager) getSystemService(Context.POWER_SERVICE); - wakeLock = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock"); - vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); - if (code == -1) { - finish(); - } else { - wakeLock.acquire(60 * 1000L); - long[] pattern = {1000, 5000, 1000, 5000}; - vibrator.vibrate(pattern, 0); - WakeUpUtils.wakeUpAndUnlockScreen(this); - HashMap oldData = AlarmUtils.getInstance().getOldData(); - alarmClockData = oldData.get(code); - if (alarmClockData == null) { - finish(); - } - Log.e(TAG, "onCreate: " + alarmClockData); - showData(alarmClockData); - } - - } - - private void showData(AlarmClockData alarmClockData) { - audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); - int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); - audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, maxVolume, AudioManager.FLAG_PLAY_SOUND); - tv_title.setText(alarmClockData.getTitle()); - bt_ok.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - HashMap oldData = AlarmUtils.getInstance().getOldData(); - AlarmClockData alarm = oldData.get(code); - if (alarm != null) { - alarm.setFinished(true); - AlarmUtils.getInstance().updateAlarmFinished(alarm); - } - } - }); - String voiceUrl = alarmClockData.getVoice(); - String voicemd5 = alarmClockData.getVoice_md5(); - String filePath = alarmClockData.getFile(); - - if (!TextUtils.isEmpty(voiceUrl)) { - cl_voice.setVisibility(View.VISIBLE); - String fileName = Utils.getFileNamefromURL(voiceUrl); - File file = new File(Utils.getDownLoadPath(NoticeActivity.this) + fileName); - String fileMD5 = FileUtils.getFileMD5ToString(file); -// if (!md5.equals(fileMD5)) { -// // TODO: 2021/12/16 -// } else { - mediaPlayer = new MediaPlayer(); - try { - // 切歌之前先重置,释放掉之前的资源 - mediaPlayer.reset(); - FileInputStream fis = new FileInputStream(file); - mediaPlayer.setDataSource(fis.getFD()); - // 设置播放源 -// mediaPlayer.setDataSource(file.getAbsolutePath()); - // 开始播放前的准备工作,加载多媒体资源,获取相关信息 - mediaPlayer.prepare(); - // 开始播放 - mediaPlayer.start(); - } catch (IOException e) { - e.printStackTrace(); - Log.e(TAG, "showData: " + e.getMessage()); - } -// } - } else { - cl_voice.setVisibility(View.GONE); - } - if (!TextUtils.isEmpty(filePath)) { - cl_vp.setVisibility(View.VISIBLE); - String fileType = FileUtil.getFileType(filePath); - Log.e(TAG, "showData: " + fileType); - if (FileUtil.isPictureFile(fileType)) { - jz_video.setVisibility(View.GONE); - imageView.setVisibility(View.VISIBLE); - RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtils.dip2px(this, 16F))); - Glide.with(NoticeActivity.this).load(filePath).apply(options).into(imageView); - } else if (FileUtil.isVideoFile(fileType)) { - jz_video.setVisibility(View.VISIBLE); - imageView.setVisibility(View.GONE); - String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length()); - String realPath = Utils.getDownLoadPath(NoticeActivity.this) + fileName; - File file = new File(realPath); - JZDataSource jzDataSource; - if (!file.exists()) { - jzDataSource = new JZDataSource(filePath, ""); - Log.e(TAG, "showData: not exists"); - } else { - Log.e(TAG, "showData: exists " + file); - URI uri = file.toURI(); - jzDataSource = new JZDataSource(uri.toString(), ""); - } - jzDataSource.looping = true; - jz_video.setUp(jzDataSource, Jzvd.SCREEN_NORMAL); - jz_video.startPreloading(); - jz_video.startVideoAfterPreloading(); - jz_video.startVideo(); - } - } else { - cl_vp.setVisibility(View.GONE); - } - - } - - @Override - protected void onDestroy() { - super.onDestroy(); - if (mediaPlayer != null) { - if (mediaPlayer.isPlaying()) { - mediaPlayer.stop(); - } - mediaPlayer.release(); - mediaPlayer = null; - } - } - - @Override - public void onBackPressed() { - if (Jzvd.backPress()) { - return; - } - super.onBackPressed(); - } - - @Override - protected void onPause() { - super.onPause(); - Jzvd.releaseAllVideos(); - } -} diff --git a/app/src/main/java/com/uiui/zyos/activity/main/MainActivity.java b/app/src/main/java/com/uiui/zyos/activity/main/MainActivity.java index ea1e7df..127d161 100644 --- a/app/src/main/java/com/uiui/zyos/activity/main/MainActivity.java +++ b/app/src/main/java/com/uiui/zyos/activity/main/MainActivity.java @@ -6,12 +6,10 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.content.ServiceConnection; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.graphics.Color; import android.os.Bundle; -import android.os.IBinder; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; @@ -22,7 +20,6 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.viewpager.widget.ViewPager; -import com.alarmclock.uiui.IAlarmAidlInterface; import com.flyco.tablayout.SlidingTabLayout; import com.tencent.mmkv.MMKV; import com.uiui.zyos.BuildConfig; @@ -31,11 +28,14 @@ import com.uiui.zyos.base.BaseActivity; import com.uiui.zyos.base.BaseFragmentPagerAdapter; import com.uiui.zyos.config.CommonConfig; import com.uiui.zyos.dialog.PrivacyPolicyDialog; -import com.uiui.zyos.fragment.custom.CustomFragment; +import com.uiui.zyos.fragment.biology.BiologyFragment; +import com.uiui.zyos.fragment.chemical.ChemicalFragment; +import com.uiui.zyos.fragment.chinese.ChineseFragment; +import com.uiui.zyos.fragment.english.EnglishFragment; +import com.uiui.zyos.fragment.math.MathFragment; +import com.uiui.zyos.fragment.physics.PhysicsFragment; import com.uiui.zyos.service.NotificationService; -import com.uiui.zyos.utils.AppUsedTimeUtils; import com.uiui.zyos.utils.HomeWatcher; -import com.uiui.zyos.utils.LauncherUtils; import com.uiui.zyos.utils.ToastUtil; import com.uiui.zyos.view.ScaleCircleNavigator; @@ -95,13 +95,13 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { // fragmentTransaction.add(R.id.viewPager, appListFragment); // fragmentTransaction.commit(); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); - mFragments.add(new CustomFragment()); + mFragments.add(new ChineseFragment()); + mFragments.add(new MathFragment()); + mFragments.add(new EnglishFragment()); + mFragments.add(new PhysicsFragment()); + mFragments.add(new ChemicalFragment()); + mFragments.add(new BiologyFragment()); + mFragments.add(new ChineseFragment()); scaleCircleNavigator = new ScaleCircleNavigator(this); scaleCircleNavigator.setCircleCount(mFragments.size()); @@ -129,36 +129,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { registmNewAppReceiver(); registerSOSNumberReceiver(); registerUpdateDesktopReceiver(); - mAlarmServiceConnection = new ServiceConnection() { - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - Log.e(TAG, "onServiceConnected: "); - mIAlarmAidlInterface = IAlarmAidlInterface.Stub.asInterface(service); - } - - @Override - public void onServiceDisconnected(ComponentName name) { - Log.e(TAG, "onServiceDisconnected: "); - mIAlarmAidlInterface = null; - } - }; - bindAlarmService(); - } - - private ServiceConnection mAlarmServiceConnection; - private IAlarmAidlInterface mIAlarmAidlInterface; - - private void bindAlarmService() { - if (mIAlarmAidlInterface == null) { - //这是连接aidl服务的代码 - Intent intent = new Intent(); - intent.setAction("com.alarmclock.uiui.IAlarmAidlInterface"); - intent.setPackage("com.alarmclock.uiui"); - intent.setComponent(new ComponentName("com.alarmclock.uiui", "com.alarmclock.uiui.AIDLAlarmService")); - bindService(intent, mAlarmServiceConnection, Context.BIND_AUTO_CREATE); - } else { - - } } public static void toggleNotificationListenerService(Context context) { @@ -171,9 +141,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } - @Override - public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) {//表示渲染结束 @@ -254,7 +222,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { protected void onStop() { super.onStop(); Log.e(TAG, "onStop: "); - AppUsedTimeUtils.getInstance().setEndTime(System.currentTimeMillis()); } @Override @@ -291,13 +258,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { ToastUtil.show("请授予\"" + getString(R.string.app_name) + "\"使用通知权"); gotoNotificationAccessSetting(this); } - int is_activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0); - Log.e(TAG, "onResume: is_activation = " + is_activation); - if (is_activation == 1) { - LauncherUtils.setDefaultDesktop(MainActivity.this, BuildConfig.APPLICATION_ID, this.getClass().getName()); - } else { - LauncherUtils.setDefaultDesktop(MainActivity.this, LauncherUtils.Launcher3, LauncherUtils.Launcher3Class); - } addHomeWatcher(); } @@ -330,15 +290,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView { public void onHomePressed() { //按了HOME键 Log.e(TAG, "onHomePressed: "); - int is_activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0); - Log.e(TAG, "onHomePressed: is_activation = " + is_activation); - if (is_activation == 0) { - LauncherUtils.openLauncher3(MainActivity.this); - } else { - if (!LauncherUtils.isDefaultHome(MainActivity.this)) { - LauncherUtils.setDefaultDesktop(MainActivity.this, BuildConfig.APPLICATION_ID, this.getClass().getName()); - } - } } @Override diff --git a/app/src/main/java/com/uiui/zyos/alarm/AlarmOpenHelper.java b/app/src/main/java/com/uiui/zyos/alarm/AlarmOpenHelper.java deleted file mode 100644 index a1cc4a0..0000000 --- a/app/src/main/java/com/uiui/zyos/alarm/AlarmOpenHelper.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.uiui.zyos.alarm; - -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; -import android.os.Environment; - -import java.io.File; - -public class AlarmOpenHelper extends SQLiteOpenHelper { - - public static final int DATABASE_VERSION = 1; - public static final String DATABASE_NAME = "AlarmDatabase.db"; - public static final String DATABASE_FILE_NAME = Environment.getExternalStorageDirectory().getPath() + File.separator + DATABASE_NAME; - - public static final String TABLE_ALARM = " AlarmTable"; - - public static final String KEY_ID = "id"; - public static final String KEY_TYPE = "type"; - public static final String KEY_TIME = "time"; - public static final String KEY_TITLE = "title"; - public static final String KEY_VOICE = "voice"; - public static final String KEY_VOICE_MD5 = "voice_md5"; - public static final String KEY_FILE = "file"; - public static final String KEY_REMIND_TYPE = "remind_type"; - public static final String KEY_IS_ONOFF = "is_onoff"; - public static final String KEY_FINISHED = "finished"; - - String CREATE_ALARM_TABLE = "CREATE TABLE IF NOT EXISTS" + TABLE_ALARM + - "(" - + KEY_ID + " INTEGER PRIMARY KEY," - + KEY_TYPE + " INTEGER," - + KEY_TIME + " TEXT," - + KEY_TITLE + " TEXT," - + KEY_VOICE + " TEXT," - + KEY_VOICE_MD5 + " TEXT," - + KEY_FILE + " TEXT," - + KEY_REMIND_TYPE + " INTEGER," - + KEY_IS_ONOFF + " INTEGER," - + KEY_FINISHED + " BOOLEAN DEFAULT 0" - + ")"; - - public AlarmOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { - super(context, name, factory, version); - } - - @Override - public void onCreate(SQLiteDatabase db) { - db.execSQL(CREATE_ALARM_TABLE); - } - - @Override - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - if (oldVersion >= newVersion) { - return; - } - db.execSQL("DROP TABLE IF EXISTS " + TABLE_ALARM); - onCreate(db); - } -} diff --git a/app/src/main/java/com/uiui/zyos/alarm/AlarmService.java b/app/src/main/java/com/uiui/zyos/alarm/AlarmService.java deleted file mode 100644 index 39563ec..0000000 --- a/app/src/main/java/com/uiui/zyos/alarm/AlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.uiui.zyos.alarm; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; - -public class AlarmService extends Service { - public AlarmService() { - } - - @Override - public IBinder onBind(Intent intent) { - return null; - } - -} diff --git a/app/src/main/java/com/uiui/zyos/alarm/AlarmUtils.java b/app/src/main/java/com/uiui/zyos/alarm/AlarmUtils.java deleted file mode 100644 index b67f4d5..0000000 --- a/app/src/main/java/com/uiui/zyos/alarm/AlarmUtils.java +++ /dev/null @@ -1,670 +0,0 @@ -package com.uiui.zyos.alarm; - -import android.annotation.SuppressLint; -import android.app.AlarmManager; -import android.app.PendingIntent; -import android.content.ContentValues; -import android.content.Context; -import android.content.Intent; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.text.TextUtils; -import android.util.Log; - -import com.arialyy.aria.core.Aria; -import com.blankj.utilcode.util.FileUtils; -import com.bumptech.glide.Glide; -import com.uiui.zyos.bean.AlarmClockData; -import com.uiui.zyos.service.main.MainService; -import com.uiui.zyos.utils.FileUtil; -import com.uiui.zyos.utils.Utils; - -import java.io.File; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; - -public class AlarmUtils { - @SuppressLint("StaticFieldLeak") - private static AlarmUtils sInstance; - private static String TAG = AlarmUtils.class.getSimpleName(); - private Context mContext; - private AlarmManager alarmManager; - private SQLiteDatabase db; - private AlarmOpenHelper mAlarmOpenHelper; - - public static final int ONE_DAY_TIME = 1000 * 60 * 60 * 24; - - - private AlarmUtils(Context context) { - this.mContext = context; -// this.mAlarmOpenHelper = new AlarmOpenHelper(context, AlarmOpenHelper.DATABASE_NAME, null, AlarmOpenHelper.DATABASE_VERSION); - this.mAlarmOpenHelper = new AlarmOpenHelper(context, AlarmOpenHelper.DATABASE_FILE_NAME, null, AlarmOpenHelper.DATABASE_VERSION); - this.db = mAlarmOpenHelper.getWritableDatabase(); - alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); - } - - public static void init(Context context) { - if (context == null) { - throw new RuntimeException("context is NULL"); - } - if (sInstance == null) { - sInstance = new AlarmUtils(context); - } - } - - public static AlarmUtils getInstance() { - if (sInstance == null) { - throw new IllegalStateException("You must be init AmapManager first"); - } - return sInstance; - } - - private void open() { - if (db == null || !db.isOpen()) { - db = mAlarmOpenHelper.getWritableDatabase(); - } - } - - /** - * 增加数据 - * - * @param alarmClockData - * @return - */ - public boolean addAlarmClock(AlarmClockData alarmClockData) { - open(); - ContentValues values = new ContentValues(); - values.put(AlarmOpenHelper.KEY_ID, alarmClockData.getId()); - values.put(AlarmOpenHelper.KEY_TYPE, alarmClockData.getType()); - values.put(AlarmOpenHelper.KEY_TIME, alarmClockData.getTime()); - values.put(AlarmOpenHelper.KEY_TITLE, alarmClockData.getTitle()); - values.put(AlarmOpenHelper.KEY_VOICE, alarmClockData.getVoice()); - values.put(AlarmOpenHelper.KEY_VOICE_MD5, alarmClockData.getVoice_md5()); - values.put(AlarmOpenHelper.KEY_FILE, alarmClockData.getFile()); - values.put(AlarmOpenHelper.KEY_REMIND_TYPE, alarmClockData.getRemind_type()); - values.put(AlarmOpenHelper.KEY_IS_ONOFF, alarmClockData.getIs_onoff()); - long id = 0; - db.beginTransaction(); - try { - id = db.insert(AlarmOpenHelper.TABLE_ALARM, null, values); - } catch (Exception e) { - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } - db.close(); - return id > 0; - } - - - /** - * 更新数据 - * - * @param alarmClockData - * @return - */ - public boolean updateAlarmClock(AlarmClockData alarmClockData) { - open(); - ContentValues values = new ContentValues(); - values.put(AlarmOpenHelper.KEY_ID, alarmClockData.getId()); - values.put(AlarmOpenHelper.KEY_TYPE, alarmClockData.getType()); - values.put(AlarmOpenHelper.KEY_TIME, alarmClockData.getTime()); - values.put(AlarmOpenHelper.KEY_TITLE, alarmClockData.getTitle()); - values.put(AlarmOpenHelper.KEY_VOICE, alarmClockData.getVoice()); - values.put(AlarmOpenHelper.KEY_VOICE_MD5, alarmClockData.getVoice_md5()); - values.put(AlarmOpenHelper.KEY_FILE, alarmClockData.getFile()); - values.put(AlarmOpenHelper.KEY_REMIND_TYPE, alarmClockData.getRemind_type()); - values.put(AlarmOpenHelper.KEY_IS_ONOFF, alarmClockData.getIs_onoff()); - long id = 0; - db.beginTransaction(); - try { - id = db.insertWithOnConflict(AlarmOpenHelper.TABLE_ALARM, null, values, SQLiteDatabase.CONFLICT_REPLACE); - db.setTransactionSuccessful(); - } catch (Exception e) { - Log.e(TAG, "updateAlarmClock: " + e.getMessage()); - } finally { - db.endTransaction(); - } - db.close(); - return id > 0; - } - - /** - * 批量插入数据 - * - * @param list - */ - public void insertListValues(List list) { - open(); - List contentValuesList = new ArrayList<>(); - for (AlarmClockData alarmClockData : list) { - ContentValues values = new ContentValues(); - values.put(AlarmOpenHelper.KEY_ID, alarmClockData.getId()); - values.put(AlarmOpenHelper.KEY_TYPE, alarmClockData.getType()); - values.put(AlarmOpenHelper.KEY_TIME, alarmClockData.getTime()); - values.put(AlarmOpenHelper.KEY_TITLE, alarmClockData.getTitle()); - values.put(AlarmOpenHelper.KEY_VOICE, alarmClockData.getVoice()); - values.put(AlarmOpenHelper.KEY_VOICE_MD5, alarmClockData.getVoice_md5()); - values.put(AlarmOpenHelper.KEY_FILE, alarmClockData.getFile()); - values.put(AlarmOpenHelper.KEY_REMIND_TYPE, alarmClockData.getRemind_type()); - values.put(AlarmOpenHelper.KEY_IS_ONOFF, alarmClockData.getIs_onoff()); - values.put(AlarmOpenHelper.KEY_FINISHED, alarmClockData.isFinished()); - contentValuesList.add(values); - } - db.beginTransaction(); - try { - for (ContentValues v : contentValuesList) { - db.insertWithOnConflict(AlarmOpenHelper.TABLE_ALARM, null, v, SQLiteDatabase.CONFLICT_REPLACE); - } - db.setTransactionSuccessful(); - } catch (Exception e) { - Log.e(TAG, "insertListValues: " + e.getMessage()); - } finally { - db.endTransaction(); - } - db.close(); - } - - /** - * 删除数据 - * - * @param alarmClockData - * @return - */ - public boolean deleteAlarmClock(AlarmClockData alarmClockData) { - if (alarmClockData == null) { - return false; - } - return deleteAlarmClock(alarmClockData.getId()); - } - - public boolean deleteAlarmClock(int RowID) { - open(); - long id = 0; - db.beginTransaction(); - try { - id = db.delete(AlarmOpenHelper.TABLE_ALARM, "id =" + RowID, null); - db.setTransactionSuccessful(); - } catch (Exception e) { - Log.e(TAG, "deleteAlarmClock: " + e.getMessage()); - } finally { - db.endTransaction(); - } - db.close(); - return id > 0; - } - - public void deleteAllAlarmClock() { - HashSet pendingIntents = getOldPendingIntents(); - Iterator pendingIntentIterator = pendingIntents.iterator(); - while (pendingIntentIterator.hasNext()) { - PendingIntent pendingIntent = pendingIntentIterator.next(); - alarmManager.cancel(pendingIntent); - pendingIntentIterator.remove(); - } - List alarmClockData = getAllAlarms(); - for (AlarmClockData data : alarmClockData) { - deleteAlarmClock(data.getId()); - } - } - - /** - * 获取所有Alarm - * - * @return - */ - public List getAllAlarms() { - open(); - List list = new ArrayList<>(); - String selectQuery = "SELECT * FROM " + AlarmOpenHelper.TABLE_ALARM; - open(); - Cursor cursor = db.rawQuery(selectQuery, null); - if (cursor.moveToFirst()) { - do { - AlarmClockData alarmClockData = new AlarmClockData(); - alarmClockData.setId(Integer.parseInt(cursor.getString(0))); - alarmClockData.setType(cursor.getInt(1)); - alarmClockData.setTime(cursor.getString(2)); - alarmClockData.setTitle(cursor.getString(3)); - alarmClockData.setVoice(cursor.getString(4)); - alarmClockData.setVoice_md5(cursor.getString(5)); - alarmClockData.setFile(cursor.getString(6)); - alarmClockData.setRemind_type(cursor.getInt(7)); - alarmClockData.setIs_onoff(cursor.getInt(8)); - if (cursor.getInt(9) == 1) { - alarmClockData.setFinished(true); - } else { - alarmClockData.setFinished(false); - } - list.add(alarmClockData); - } while (cursor.moveToNext()); - } - cursor.close(); - db.close(); - return list; - } - - - private HashSet pendingIntents; - - /** - * 设置闹钟列表 - * - * @param data - */ - public void setAlarmClockData(List data) { - if (pendingIntents == null) { - pendingIntents = getOldPendingIntents(); - } - Iterator pendingIntentIterator = pendingIntents.iterator(); - while (pendingIntentIterator.hasNext()) { - PendingIntent pendingIntent = pendingIntentIterator.next(); - alarmManager.cancel(pendingIntent); - pendingIntentIterator.remove(); - } -// for (PendingIntent pendingIntent : pendingIntents) { -// -// } - List newData = mergeData(data); - for (AlarmClockData clockData : newData) { - setAlarm(clockData); - checkResource(clockData.getFile()); - } - insertListValues(newData); - } - - private void checkResource(String url) { - if (TextUtils.isEmpty(url)) - return; - String fileName = url.substring(url.lastIndexOf("/") + 1, url.length()); - if (FileUtil.isVideoFile(fileName)) { - String realPath = Utils.getDownLoadPath(mContext) + fileName; - File file = new File(realPath); - if (!file.exists()) { - Aria.download(this) - .load(url) //读取下载地址 - .setFilePath(Utils.getDownLoadPath(mContext) + fileName) - // .ignoreFilePathOccupy() - .create(); //启动下载} - } - }else if (FileUtil.isPictureFile(fileName)){ - Glide.with(mContext).load(url); - } - } - - /** - * 合并闹钟列表,删除不存在闹钟 - * - * @param alarmClockDataList - * @return - */ - private List mergeData(List alarmClockDataList) { - HashMap alarmClockDataMap = new HashMap<>(); - if (alarmClockDataList != null) { - for (AlarmClockData alarmClockData : alarmClockDataList) { - alarmClockDataMap.put(alarmClockData.getId(), alarmClockData); - } - } - HashMap oldData = getOldData(); - List deleteData = new ArrayList<>(); - for (Map.Entry entry : oldData.entrySet()) { - if (alarmClockDataMap.get(entry.getKey()) == null) { - deleteData.add(entry.getValue()); - } - } - for (AlarmClockData alarmClockData : deleteData) { - deleteAlarmClock(alarmClockData); - } - - List newData = new ArrayList<>(); - if (alarmClockDataList == null) { - return newData; - } - for (AlarmClockData alarm : alarmClockDataList) { - AlarmClockData oldAlarm = oldData.get(alarm.getId()); - if (oldAlarm == null) { - newData.add(alarm); - } else { - if (oldAlarm.equals(alarm)) { - newData.add(oldAlarm); - } else { - newData.add(alarm); - } - } - } - return newData; - } - - /** - * 更新完成状态 - * - * @param alarmClockData - * @return - */ - public boolean updateAlarmFinished(AlarmClockData alarmClockData) { - open(); - ContentValues values = new ContentValues(); - values.put(AlarmOpenHelper.KEY_ID, alarmClockData.getId()); - values.put(AlarmOpenHelper.KEY_TYPE, alarmClockData.getType()); - values.put(AlarmOpenHelper.KEY_TIME, alarmClockData.getTime()); - values.put(AlarmOpenHelper.KEY_TITLE, alarmClockData.getTitle()); - values.put(AlarmOpenHelper.KEY_VOICE, alarmClockData.getVoice()); - values.put(AlarmOpenHelper.KEY_VOICE_MD5, alarmClockData.getVoice_md5()); - values.put(AlarmOpenHelper.KEY_FILE, alarmClockData.getFile()); - values.put(AlarmOpenHelper.KEY_REMIND_TYPE, alarmClockData.getRemind_type()); - values.put(AlarmOpenHelper.KEY_IS_ONOFF, alarmClockData.getIs_onoff()); - values.put(AlarmOpenHelper.KEY_FINISHED, alarmClockData.isFinished()); - long id = 0; - db.beginTransaction(); - try { - id = db.update(AlarmOpenHelper.TABLE_ALARM, values, AlarmOpenHelper.KEY_ID + "=?", new String[]{String.valueOf(alarmClockData.getId())}); - db.setTransactionSuccessful(); - } catch (Exception e) { - Log.e(TAG, "updateAlarmFinished: " + e.getMessage()); - } finally { - db.endTransaction(); - } - db.close(); - return id > 0; - } - - public HashMap getOldData() { - List alarmClockData = getAllAlarms(); - if (alarmClockData == null || alarmClockData.size() == 0) { - return new HashMap<>(); - } else { - HashMap hashMap = new HashMap<>(); - for (AlarmClockData clockData : alarmClockData) { - hashMap.put(clockData.getId(), clockData); - } - return hashMap; - } - } - - - /** - * 获取最近一次的闹钟 - * - * @return - */ - public AlarmClockData getRecentAlarmClock() { - List alarmClockData = getAllAlarms(); - if (alarmClockData == null || alarmClockData.size() == 0) { - return null; - } else { - Collections.sort(alarmClockData, new Comparator() { - @Override - public int compare(AlarmClockData o1, AlarmClockData o2) { - if ((o1.getTimeStamp()) <= (o2.getTimeStamp())) { - return 0; - } else { - return -1; - } - } - }); - return alarmClockData.get(0); - } - } - - private HashSet getOldPendingIntents() { - HashSet pendingIntents = new HashSet<>(); - HashMap data = getOldData(); - for (AlarmClockData alarmClockData : data.values()) { - pendingIntents.add(getPendingIntent(alarmClockData)); - } - return pendingIntents; - } - - private PendingIntent getPendingIntent(AlarmClockData alarmClock) { - Intent intent = new Intent(MainService.ALARMWAKEUP); - intent.putExtra("title", alarmClock.getTitle()); - intent.putExtra("id", alarmClock.getId()); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, alarmClock.getId(), intent, PendingIntent.FLAG_CANCEL_CURRENT); - return startPendingIntent; - } - - private long getTimestamp(String timeString) { - if (TextUtils.isEmpty(timeString)) { - return 0; - } - if (timeString.length() == 5) { - String[] timeSplit = timeString.split(":"); - int hour = Integer.parseInt(timeSplit[0]); - int minute = Integer.parseInt(timeSplit[1]); - Calendar c = Calendar.getInstance(); - int year = c.get(Calendar.YEAR); - int month = c.get(Calendar.MONTH); - int day = c.get(Calendar.DAY_OF_MONTH); - c.set(year, month, day, hour, minute, 0); - long mTimeInfo = c.getTimeInMillis(); - Log.e(TAG, "getTimestamp: " + mTimeInfo); -// long actualTime = mTimeInfo > System.currentTimeMillis() ? mTimeInfo : mTimeInfo + ONE_DAY_TIME; - return mTimeInfo; - } else { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - try { - Date date = simpleDateFormat.parse(timeString); - long timestamp = date.getTime(); - Log.e(TAG, "getTimestamp2: " + timestamp); - return timestamp; - } catch (ParseException e) { - return System.currentTimeMillis(); - } - } - } - - private long getZeroTiemstamp() { - //设置时区 - Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+8")); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - long zeroTime = calendar.getTimeInMillis(); - Log.e(TAG, "getZeroTiemstamp: " + zeroTime); - return zeroTime; - } - - /*一次性*/ - public static final int ONCE = 1; - /*每天*/ - public static final int LOOP = 2; - /*周一到周五*/ - public static final int WORKING_DAY = 3; - /*休息日*/ - public static final int OFF_DAY = 4; - - /** - * 设置闹钟 - * - * @param alarm - */ - public void setAlarm(AlarmClockData alarm) { - int id = alarm.getId(); - int type = alarm.getType(); - String timeString = alarm.getTime(); - String title = alarm.getTitle(); - Log.e(TAG, "setAlarm: " + title); - long timeStamp = getTimestamp(timeString); - Log.e(TAG, "setAlarm: " + timeStamp); - boolean finished = alarm.isFinished(); - String url = alarm.getVoice(); - String md5 = alarm.getVoice_md5(); - if (!TextUtils.isEmpty(url)) { - ariaDownload(url, md5); - } - switch (type) { - case ONCE: - if (!finished) { - if (timeStamp < System.currentTimeMillis()) { - Intent intent = new Intent(MainService.ALARMWAKEUP); - intent.putExtra("title", title); - intent.putExtra("id", id); - mContext.sendBroadcast(intent); - } else { - setOnceAlarm(MainService.ALARMWAKEUP, title, id, timeStamp); - } - } - break; - case LOOP: - setDayLoopAlarm(MainService.ALARMWAKEUP, title, id, timeString); - break; - case WORKING_DAY: - setWorkDayAlarm(MainService.ALARMWAKEUP, title, id, timeString); - break; - case OFF_DAY: - setOffDayAlarm(MainService.ALARMWAKEUP, title, id, timeString); - break; - default: - } - } - - /** - * @param action - * @param requestCode - * @param timestamp 设置一次性闹钟 - */ - public void setOnceAlarm(String action, String extra, int requestCode, long timestamp) { - Intent intent = new Intent(action); - intent.putExtra("title", extra); - intent.putExtra("id", requestCode); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); - pendingIntents.add(startPendingIntent); - alarmManager.setAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent); - Log.e(TAG, "setOnceAlarm: " + "id: " + requestCode + " title: " + extra + " timeString: " + timestamp); - } - - /** - * @param action - * @param requestCode - * @param timeString 设置循环周期为一天的闹钟 - */ - public void setDayLoopAlarm(String action, String extra, int requestCode, String timeString) { - long timestamp = getTimestamp(timeString); - if (System.currentTimeMillis() > timestamp) { - timestamp += AlarmManager.INTERVAL_DAY; - } - Intent intent = new Intent(action); - intent.putExtra("title", extra); - intent.putExtra("id", requestCode); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); - pendingIntents.add(startPendingIntent); - alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent); - Log.e(TAG, "setDayLoopAlarm: " + "title: " + extra + " timeString: " + timestamp); -// setLoopAlarm(action, extra, requestCode, AlarmManager.INTERVAL_DAY, timestamp); - } - - /** - * @param action - * @param requestCode - * @param timestamp 设置循环周期为一小时的闹钟 - */ - public void setHourLoopAlarm(String action, String extra, int requestCode, long timestamp) { - setLoopAlarm(action, extra, requestCode, AlarmManager.INTERVAL_HOUR, timestamp); - } - - /** - * @param action - * @param requestCode - * @param intervalMillis - * @param timestamp 循环闹钟 - */ - public void setLoopAlarm(String action, String extra, int requestCode, long intervalMillis, long timestamp) { - Intent intent = new Intent(action); - intent.putExtra("title", extra); - intent.putExtra("id", requestCode); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); - pendingIntents.add(startPendingIntent); - alarmManager.setWindow(AlarmManager.RTC_WAKEUP, timestamp, intervalMillis, startPendingIntent); - Log.e(TAG, "setLoopAlarm: " + "title: " + extra + " timeString: " + timestamp); - } - - public void setWorkDayAlarm(String action, String extra, int requestCode, String timeString) { - long timestamp = getTimestamp(timeString); - Calendar calendar = Calendar.getInstance(); - int day_of_week = calendar.get(Calendar.DAY_OF_WEEK) - 1; - switch (day_of_week) { - case 6: - case 7: - timestamp += (8 - day_of_week) * AlarmManager.INTERVAL_DAY; - break; - default: - if (System.currentTimeMillis() > timestamp) { - timestamp += AlarmManager.INTERVAL_DAY; - } - break; - } - Intent intent = new Intent(action); - intent.putExtra("title", extra); - intent.putExtra("id", requestCode); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); - pendingIntents.add(startPendingIntent); - alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent); - Log.e(TAG, "setWorkDayAlarm: " + "title: " + extra + " timeString: " + timestamp); - } - - public void setOffDayAlarm(String action, String extra, int requestCode, String timeString) { - long timestamp = getTimestamp(timeString); - Calendar calendar = Calendar.getInstance(); - int day_of_week = calendar.get(Calendar.DAY_OF_WEEK) - 1; - switch (day_of_week) { - case 6: - if (System.currentTimeMillis() > timestamp) { - timestamp += AlarmManager.INTERVAL_DAY; - } - break; - case 7: - break; - default: - timestamp += (6 - day_of_week) * AlarmManager.INTERVAL_DAY; - break; - } - Intent intent = new Intent(action); - intent.putExtra("title", extra); - intent.putExtra("id", requestCode); - PendingIntent startPendingIntent = PendingIntent.getBroadcast(mContext, requestCode, intent, PendingIntent.FLAG_CANCEL_CURRENT); - pendingIntents.add(startPendingIntent); - alarmManager.setExact(AlarmManager.RTC_WAKEUP, timestamp, startPendingIntent); - Log.e(TAG, "setOffDayAlarm: " + "title: " + extra + " timeString: " + timestamp); - } - - - public void ariaDownload(String url, String md5) { - String fileName = Utils.getFileNamefromURL(url); - File file = new File(Utils.getDownLoadPath(mContext) + fileName); - if (file.exists() && !file.isDirectory()) { - String fileMD5 = FileUtils.getFileMD5ToString(file); - Log.e("ariaDownload", "fileOnlineMD5=" + md5); - Log.e("ariaDownload", "fileMD5=" + fileMD5); - if (!md5.equals(fileMD5)) { - Aria.download(this) - .load(url) //读取下载地址 - .setFilePath(Utils.getDownLoadPath(mContext) + fileName) -// .ignoreFilePathOccupy() - .setExtendField(md5) - .create(); //启动下载} - } else { - Log.e("ariaDownload", "fileName = " + fileName + " exists"); - } - } else { - Aria.download(this) - .load(url) //读取下载地址 - .setFilePath(Utils.getDownLoadPath(mContext) + fileName) -// .ignoreFilePathOccupy() - .setExtendField(md5) - .create(); //启动下载} - } - } - - -} diff --git a/app/src/main/java/com/uiui/zyos/base/BaseApplication.java b/app/src/main/java/com/uiui/zyos/base/BaseApplication.java index db2b5ef..1c5615b 100644 --- a/app/src/main/java/com/uiui/zyos/base/BaseApplication.java +++ b/app/src/main/java/com/uiui/zyos/base/BaseApplication.java @@ -12,12 +12,10 @@ import com.tencent.android.tpush.XGPushConfig; import com.tencent.android.tpush.XGPushManager; import com.tencent.mmkv.MMKV; import com.uiui.zyos.BuildConfig; -import com.uiui.zyos.alarm.AlarmUtils; import com.uiui.zyos.manager.ConnectManager; import com.uiui.zyos.manager.RemoteManager; import com.uiui.zyos.network.NetInterfaceManager; import com.uiui.zyos.service.main.MainService; -import com.uiui.zyos.utils.AppUsedTimeUtils; import com.uiui.zyos.utils.SystemUtils; import com.uiui.zyos.utils.Utils; @@ -43,8 +41,6 @@ public class BaseApplication extends Application { Aria.init(this); Aria.get(this).getDownloadConfig().setMaxTaskNum(1); Aria.get(this).getDownloadConfig().setConvertSpeed(true); - AppUsedTimeUtils.init(this); - AlarmUtils.init(this); tpushInit(); RemoteManager.init(this); ConnectManager.init(this); diff --git a/app/src/main/java/com/uiui/zyos/view/CustomContent.java b/app/src/main/java/com/uiui/zyos/base/CustomContent.java similarity index 98% rename from app/src/main/java/com/uiui/zyos/view/CustomContent.java rename to app/src/main/java/com/uiui/zyos/base/CustomContent.java index df9c87d..ab9b9e4 100644 --- a/app/src/main/java/com/uiui/zyos/view/CustomContent.java +++ b/app/src/main/java/com/uiui/zyos/base/CustomContent.java @@ -1,4 +1,4 @@ -package com.uiui.zyos.view; +package com.uiui.zyos.base; import android.content.Context; import android.util.AttributeSet; diff --git a/app/src/main/java/com/uiui/zyos/view/CustomContentCallbacks.java b/app/src/main/java/com/uiui/zyos/base/CustomContentCallbacks.java similarity index 95% rename from app/src/main/java/com/uiui/zyos/view/CustomContentCallbacks.java rename to app/src/main/java/com/uiui/zyos/base/CustomContentCallbacks.java index 952e686..d5b771d 100644 --- a/app/src/main/java/com/uiui/zyos/view/CustomContentCallbacks.java +++ b/app/src/main/java/com/uiui/zyos/base/CustomContentCallbacks.java @@ -1,4 +1,4 @@ -package com.uiui.zyos.view; +package com.uiui.zyos.base; // add by codemx.cn ---- 20190712 ---plus- start diff --git a/app/src/main/java/com/uiui/zyos/bean/AlarmClockData.java b/app/src/main/java/com/uiui/zyos/bean/AlarmClockData.java deleted file mode 100644 index 5a3ed60..0000000 --- a/app/src/main/java/com/uiui/zyos/bean/AlarmClockData.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.uiui.zyos.bean; - -import android.text.TextUtils; -import android.util.Log; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.google.gson.Gson; -import com.google.gson.JsonParser; -import com.uiui.zyos.alarm.AlarmUtils; - -import java.io.Serializable; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -public class AlarmClockData implements Serializable { - private static final long serialVersionUID = -5856502480745183157L; - - int id; - int type;//类型 1一次 2循环 3周一到周五 4 周六周日 - String time;//"2021-11-15 18:33:23",//时间格式化字符串,循环类型是18:33:23 - String title;//标题 - String voice;//语音文件地址 - String voice_md5; - String file;//图片或视频文件地址 - int remind_type; - int is_onoff;//0关闭 1开启 - - boolean finished = false; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getType() { - return type; - } - - public void setType(int type) { - this.type = type; - } - - public String getTime() { - return time; - } - - public void setTime(String time) { - this.time = time; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getVoice() { - return voice; - } - - public void setVoice(String voice) { - this.voice = voice; - } - - public String getVoice_md5() { - return voice_md5; - } - - public void setVoice_md5(String voice_md5) { - this.voice_md5 = voice_md5; - } - - public String getFile() { - return file; - } - - public void setFile(String file) { - this.file = file; - } - - public boolean isFinished() { - return finished; - } - - public void setFinished(boolean finished) { - this.finished = finished; - } - - public int getRemind_type() { - return remind_type; - } - - public void setRemind_type(int remind_type) { - this.remind_type = remind_type; - } - - public int getIs_onoff() { - return is_onoff; - } - - public void setIs_onoff(int is_onoff) { - this.is_onoff = is_onoff; - } - - public long getTimeStamp() { - if (TextUtils.isEmpty(time)) { - return 0L; - } - if (time.length() == 5) { - String[] timeSplit = time.split(":"); - int hour = Integer.parseInt(timeSplit[0]); - int minute = Integer.parseInt(timeSplit[1]); - Calendar c = Calendar.getInstance(); - c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), - c.get(Calendar.DAY_OF_MONTH), hour, minute, 0); - long mTimeInfo = c.getTimeInMillis(); - Log.e("AlarmClockData", "getTimeStamp: " + mTimeInfo); - long actualTime = mTimeInfo > System.currentTimeMillis() ? mTimeInfo : mTimeInfo + AlarmUtils.ONE_DAY_TIME; - return actualTime; - } else { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - Date date = simpleDateFormat.parse(time); - long timestamp = date.getTime(); - return timestamp; - } catch (ParseException e) { - return System.currentTimeMillis(); - } - } - } - - - @NonNull - @Override - public String toString() { - return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString(); - } - - @Override - public boolean equals(@Nullable Object obj) { - if (obj == null) return false; - if (!(obj instanceof AlarmClockData)) return false; - if (id != ((AlarmClockData) obj).id) return false; - if (type != ((AlarmClockData) obj).type) return false; - if (!time.equals(((AlarmClockData) obj).time)) return false; - if (!title.equals(((AlarmClockData) obj).title)) return false; - if (!voice.equals(((AlarmClockData) obj).voice)) return false; - if (!voice_md5.equals(((AlarmClockData) obj).voice_md5)) return false; - if (!file.equals(((AlarmClockData) obj).file)) return false; - if (remind_type != ((AlarmClockData) obj).remind_type) return false; - if (is_onoff != ((AlarmClockData) obj).is_onoff) return false; - - return true; - } -} diff --git a/app/src/main/java/com/uiui/zyos/fragment/biology/BiologyFragment.java b/app/src/main/java/com/uiui/zyos/fragment/biology/BiologyFragment.java new file mode 100644 index 0000000..31d39e7 --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/biology/BiologyFragment.java @@ -0,0 +1,65 @@ +package com.uiui.zyos.fragment.biology; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.uiui.zyos.R; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link BiologyFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class BiologyFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public BiologyFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment BiologyFragment. + */ + // TODO: Rename and change types and number of parameters + public static BiologyFragment newInstance(String param1, String param2) { + BiologyFragment fragment = new BiologyFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_biology, container, false); + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/chemical/ChemicalFragment.java b/app/src/main/java/com/uiui/zyos/fragment/chemical/ChemicalFragment.java new file mode 100644 index 0000000..c46bf1b --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/chemical/ChemicalFragment.java @@ -0,0 +1,65 @@ +package com.uiui.zyos.fragment.chemical; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.uiui.zyos.R; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link ChemicalFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class ChemicalFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public ChemicalFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment ChemicalFragment. + */ + // TODO: Rename and change types and number of parameters + public static ChemicalFragment newInstance(String param1, String param2) { + ChemicalFragment fragment = new ChemicalFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_chemical, container, false); + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseContact.java b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseContact.java new file mode 100644 index 0000000..584b62e --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseContact.java @@ -0,0 +1,15 @@ +package com.uiui.zyos.fragment.chinese; + + +import com.uiui.zyos.base.BasePresenter; +import com.uiui.zyos.base.BaseView; + +public class ChineseContact { + public interface Presenter extends BasePresenter { + + } + + public interface CustomView extends BaseView { + + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseFragment.java b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseFragment.java new file mode 100644 index 0000000..4f7f2df --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChineseFragment.java @@ -0,0 +1,294 @@ +package com.uiui.zyos.fragment.chinese; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.res.Configuration; +import android.os.BatteryManager; +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.blankj.utilcode.util.NetworkUtils; +import com.uiui.zyos.R; +import com.uiui.zyos.base.BaseFragment; +import com.uiui.zyos.manager.RemoteManager; +import com.uiui.zyos.tpush.MessageReceiver; +import com.uiui.zyos.utils.Utils; + +import java.util.Calendar; +import java.util.Date; + +import butterknife.ButterKnife; + + +/** + * A simple {@link Fragment} subclass. + * Use the {@link ChineseFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class ChineseFragment extends BaseFragment implements ChineseContact.CustomView, NetworkUtils.OnNetworkStatusChangedListener { + private static final String TAG = ChineseFragment.class.getSimpleName(); + + + private View rootView; + private Activity mContext; + private ChinesePresenter mChinesePresenter; + + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + @Override + public void onDisconnected() { + + } + + @Override + public void onConnected(NetworkUtils.NetworkType networkType) { + + } + + public ChineseFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment ChineseFragment. + */ + // TODO: Rename and change types and number of parameters + public static ChineseFragment newInstance(String param1, String param2) { + ChineseFragment fragment = new ChineseFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + NetworkUtils.registerNetworkStatusChangedListener(this); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public void onConfigurationChanged(@NonNull Configuration newConfig) { + super.onConfigurationChanged(newConfig); + } + + @Override + public void fetchData() { + Log.e(TAG, "fetchData: "); + RemoteManager.getInstance().getLocation(); + initData(); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // Inflate the layout for this fragment + rootView = inflater.inflate(R.layout.fragment_chinese, container, false); + mContext = (Activity) rootView.getContext(); + mChinesePresenter = new ChinesePresenter(mContext); + mChinesePresenter.attachView(this); + mChinesePresenter.setLifecycle(lifecycleSubject); + ButterKnife.bind(this, rootView); + initView(); + return rootView; + } + + private void initView() { + Log.e(TAG, "initView: " + Utils.getBatteryLevel(mContext)); + registerBatteryReceiver(); + registerAlarmClockReceiver(); + registTimeReceiver(); + mContext.registerReceiver(mbatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); + } + + private void initData() { + initAmap(); + } + + @Override + public void onStart() { + super.onStart(); + } + + @Override + public void onPause() { + super.onPause(); + } + + @Override + public void onResume() { + super.onResume(); + } + + + private void initAmap() { + } + + private void registerAlarmClockReceiver() { + if (null == mAlarmClockReceiver) { + mAlarmClockReceiver = new AlarmClockReceiver(); + } + IntentFilter filter = new IntentFilter(); + filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); + filter.addAction(MessageReceiver.SET_ALARMCLOCK); + mContext.registerReceiver(mAlarmClockReceiver, filter); + } + + private AlarmClockReceiver mAlarmClockReceiver; + + private class AlarmClockReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + Log.e(TAG, "onReceive: " + action); + } + } + + private void registerBatteryReceiver() { + if (null == batteryReceiver) { + batteryReceiver = new BatteryReceiver(); + } + IntentFilter filter = new IntentFilter(); + filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); + filter.addAction(Intent.ACTION_BATTERY_CHANGED); + filter.addAction(Intent.ACTION_BATTERY_LOW); + filter.addAction(Intent.ACTION_BATTERY_OKAY); + filter.addAction(Intent.ACTION_POWER_CONNECTED); + filter.addAction(Intent.ACTION_POWER_DISCONNECTED); + mContext.registerReceiver(batteryReceiver, filter); + } + + private BatteryReceiver batteryReceiver; + + private class BatteryReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { + // 当前电量 + int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); + // 最大电量 + int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0); + int elec = (level * 100) / scale; + Log.i(TAG, "electricity:=" + elec + "%"); +// tv_battery.setText(elec + "%"); + } else if (Intent.ACTION_POWER_CONNECTED.equals(action) + || Intent.ACTION_POWER_DISCONNECTED.equals(action) + || Intent.ACTION_BATTERY_LOW.equals(action) + || Intent.ACTION_BATTERY_OKAY.equals(action) + ) { + + } + } + } + + private BroadcastReceiver mbatteryReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + Log.i(TAG, "onReceive: " + action); + if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { + int status = intent.getIntExtra("status", BatteryManager.BATTERY_STATUS_UNKNOWN); + if (status == BatteryManager.BATTERY_STATUS_CHARGING) { + if (rootView != null) { + } + } else { + if (rootView != null) { + } + } + } + } + }; + + /** + * 时间 + */ + private void registTimeReceiver() { + if (null == mTimeReceiver) { + mTimeReceiver = new TimeReceiver(); + } + IntentFilter filter = new IntentFilter(); + filter.addAction(Intent.ACTION_DATE_CHANGED); + filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); + filter.addAction(Intent.ACTION_TIME_CHANGED); + filter.addAction(Intent.ACTION_TIME_TICK); + mContext.registerReceiver(mTimeReceiver, filter); + } + + private void unRegistTimeReceiver() { + if (null != mTimeReceiver) { + mContext.unregisterReceiver(mTimeReceiver); + } + } + + private TimeReceiver mTimeReceiver; + + class TimeReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (action.equals(Intent.ACTION_DATE_CHANGED) + || action.equals(Intent.ACTION_TIMEZONE_CHANGED) + || action.equals(Intent.ACTION_TIME_CHANGED) + || action.equals(Intent.ACTION_TIME_TICK) + ) { + } + } + } + + // 根据日期取得星期几 + public static String getWeek() { + Date date = new Date(); + String[] weeks = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"}; + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int weekIndex = cal.get(Calendar.DAY_OF_WEEK) - 1; + if (weekIndex < 0) { + weekIndex = 0; + } + return weeks[weekIndex]; + } + + @Override + public void onDestroy() { + super.onDestroy(); + mChinesePresenter.detachView(); + NetworkUtils.unregisterNetworkStatusChangedListener(this); + if (batteryReceiver != null) { + mContext.unregisterReceiver(batteryReceiver); + } + if (mbatteryReceiver != null) { + mContext.unregisterReceiver(mbatteryReceiver); + } + if (mAlarmClockReceiver != null) { + mContext.unregisterReceiver(mAlarmClockReceiver); + } + unRegistTimeReceiver(); + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/chinese/ChinesePresenter.java b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChinesePresenter.java new file mode 100644 index 0000000..e5c34b0 --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/chinese/ChinesePresenter.java @@ -0,0 +1,39 @@ +package com.uiui.zyos.fragment.chinese; + +import android.content.Context; + +import com.trello.rxlifecycle4.android.FragmentEvent; + +import io.reactivex.rxjava3.annotations.NonNull; +import io.reactivex.rxjava3.subjects.BehaviorSubject; + +public class ChinesePresenter implements ChineseContact.Presenter { + private static final String TAG = ChinesePresenter.class.getSimpleName(); + private Context mContext; + private ChineseContact.CustomView mView; + + public ChinesePresenter(Context context) { + this.mContext = context; + } + + private BehaviorSubject lifecycle; + + void setLifecycle(BehaviorSubject lifecycle) { + this.lifecycle = lifecycle; + } + + public BehaviorSubject getLifecycle() { + return lifecycle; + } + + @Override + public void attachView(@NonNull ChineseContact.CustomView view) { + this.mView = view; + } + + @Override + public void detachView() { + this.mView = null; + } + +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomContact.java b/app/src/main/java/com/uiui/zyos/fragment/custom/CustomContact.java deleted file mode 100644 index d79dbcb..0000000 --- a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomContact.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.uiui.zyos.fragment.custom; - - -import com.uiui.zyos.base.BasePresenter; -import com.uiui.zyos.base.BaseView; -import com.uiui.zyos.bean.AlarmClockData; -import com.uiui.zyos.bean.SnInfo; -import com.uiui.zyos.bean.UserAvatarInfo; - -import java.util.List; - -public class CustomContact { - public interface Presenter extends BasePresenter { - void getNetSnIsActivation(); - void getSnIsActivation(); - void getSnInfo(); - void getUserAvatarInfo(); - void getAlarmClock(); - } - - public interface CustomView extends BaseView { - void setNetSnIsActivation(boolean activation); - void setSnIsActivation(boolean activation); - void setSnInfo(SnInfo snInfo); - void setUserAvatarInfo(UserAvatarInfo userAvatarInfo); - void setAlarmClock(List clockDataList); - } -} diff --git a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomFragment.java b/app/src/main/java/com/uiui/zyos/fragment/custom/CustomFragment.java deleted file mode 100644 index 8833aae..0000000 --- a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomFragment.java +++ /dev/null @@ -1,745 +0,0 @@ -package com.uiui.zyos.fragment.custom; - -import android.app.Activity; -import android.app.ActivityManager; -import android.content.BroadcastReceiver; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.content.res.Configuration; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; -import android.os.BatteryManager; -import android.os.Bundle; -import android.os.Handler; -import android.provider.Settings; -import android.text.TextUtils; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.constraintlayout.widget.ConstraintLayout; -import androidx.fragment.app.Fragment; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -import com.blankj.utilcode.util.NetworkUtils; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.king.view.circleprogressview.CircleProgressView; -import com.tencent.mmkv.MMKV; -import com.uiui.zyos.BuildConfig; -import com.uiui.zyos.R; -import com.uiui.zyos.base.BaseFragment; -import com.uiui.zyos.bean.AlarmClockData; -import com.uiui.zyos.bean.AlarmItem; -import com.uiui.zyos.bean.Contact; -import com.uiui.zyos.bean.HealthCode; -import com.uiui.zyos.bean.SnInfo; -import com.uiui.zyos.bean.UserAvatarInfo; -import com.uiui.zyos.config.CommonConfig; -import com.uiui.zyos.dialog.SingleDialog; -import com.uiui.zyos.disklrucache.CacheHelper; -import com.uiui.zyos.manager.RemoteManager; -import com.uiui.zyos.network.NetInterfaceManager; -import com.uiui.zyos.network.UrlAddress; -import com.uiui.zyos.tpush.MessageReceiver; -import com.uiui.zyos.utils.ApkUtils; -import com.uiui.zyos.utils.AppUtil; -import com.uiui.zyos.utils.DataUtil; -import com.uiui.zyos.utils.NetStateUtils; -import com.uiui.zyos.utils.SchemeUtils; -import com.uiui.zyos.utils.ToastUtil; -import com.uiui.zyos.utils.Utils; - -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import butterknife.BindView; -import butterknife.ButterKnife; - - -/** - * A simple {@link Fragment} subclass. - * Use the {@link CustomFragment#newInstance} factory method to - * create an instance of this fragment. - */ -public class CustomFragment extends BaseFragment implements CustomContact.CustomView, NetworkUtils.OnNetworkStatusChangedListener { - private static final String TAG = CustomFragment.class.getSimpleName(); - - -// @BindView(R.id.cl_alarm) -// ConstraintLayout cl_alarm; - @BindView(R.id.cl_weather) - ConstraintLayout cl_weather; - @BindView(R.id.cl_activation) - ConstraintLayout cl_activation; - @BindView(R.id.cl_clean) - ConstraintLayout cl_clean; - @BindView(R.id.cl_sos) - ConstraintLayout cl_sos; - @BindView(R.id.cl_guard) - ConstraintLayout cl_guard; - @BindView(R.id.cl_health) - ConstraintLayout cl_health; - @BindView(R.id.cl_contact) - ConstraintLayout cl_contact; - @BindView(R.id.cl_ai) - ConstraintLayout cl_ai; - @BindView(R.id.cl_app) - ConstraintLayout cl_app; - @BindView(R.id.cl_appstore) - ConstraintLayout cl_appstore; - - // @BindView(R.id.cl_battery) -// ConstraintLayout cl_battery; - // @BindView(R.id.tv_add) -// TextView tv_add; -// @BindView(R.id.tv_battery) -// TextView tv_battery; - @BindView(R.id.tv_location) - TextView tv_location; - @BindView(R.id.tv_weather) - TextView tv_weather; - @BindView(R.id.iv_pic) - ImageView iv_pic; - @BindView(R.id.tv_temp) - TextView tv_temp; - @BindView(R.id.cpv) - CircleProgressView cpv; - // @BindView(R.id.iv_charging) -// ImageView iv_charging; -// @BindView(R.id.rv_noti) -// RecyclerView rv_noti; - // @BindView(R.id.rv_clock) -// RecyclerView rv_clock; -// @BindView(R.id.wifi_ssid) -// TextView wifi_ssid; - @BindView(R.id.iv_sos) - ImageView iv_sos; - @BindView(R.id.rv_sos) - RecyclerView rv_sos; - @BindView(R.id.iv_note_nodata) - ImageView iv_note_nodata; - // @BindView(R.id.iv_head) -// ImageView iv_head; -// @BindView(R.id.tv_name) -// TextView tv_name; - @BindView(R.id.iv_app) - ImageView iv_app; - @BindView(R.id.tv_time) - TextView tv_time; - - // private int[] mShaderColors = new int[]{0xFFfa3db5, 0xFFF8867E, 0xFFF79F6B, 0xFFF79F6B, 0xFFF79F6B, 0xFFF8867E, 0xFFfa3db5}; - private int[] mShaderColors = new int[]{0xFF27602f, 0xFF27602f, 0xFF27602f, 0xFF27602f, 0xFF27602f, 0xFF27602f, 0xFF27602f}; - private int[] mShaderColorsRed = new int[]{0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000, 0xFFFF0000}; - private View rootView; - private List alarmItemList; -// private NotificationAdapter notificationAdapter; - // private AlarmClockAdapter alarmClockAdapter; - private MMKV mMMKV; - private Activity mContext; - private ContentResolver mCRv; - private CacheHelper mCacheHelper; - private CustomPresenter mCustomPresenter; - - // TODO: Rename parameter arguments, choose names that match - // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER - private static final String ARG_PARAM1 = "param1"; - private static final String ARG_PARAM2 = "param2"; - - // TODO: Rename and change types of parameters - private String mParam1; - private String mParam2; - - @Override - public void onDisconnected() { -// wifi_ssid.setText("WiFi未连接"); - } - - @Override - public void onConnected(NetworkUtils.NetworkType networkType) { - if (networkType == NetworkUtils.NetworkType.NETWORK_WIFI) { -// wifi_ssid.setText(getConnectWifiSsid()); - } else { -// wifi_ssid.setText("WiFi未连接"); - } - } - - private String getConnectWifiSsid() { - WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); - WifiInfo wifiInfo = wifiManager.getConnectionInfo(); - Log.d("wifiInfo", wifiInfo.toString()); - Log.d("SSID", wifiInfo.getSSID()); - return wifiInfo.getSSID(); - } - - public CustomFragment() { - // Required empty public constructor - } - - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment CustomFragment. - */ - // TODO: Rename and change types and number of parameters - public static CustomFragment newInstance(String param1, String param2) { - CustomFragment fragment = new CustomFragment(); - Bundle args = new Bundle(); - args.putString(ARG_PARAM1, param1); - args.putString(ARG_PARAM2, param2); - fragment.setArguments(args); - return fragment; - } - - public void setAlarmItem(List alarmItem) { - this.alarmItemList = alarmItem; -// setAlarm(); - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - NetworkUtils.registerNetworkStatusChangedListener(this); - if (getArguments() != null) { - mParam1 = getArguments().getString(ARG_PARAM1); - mParam2 = getArguments().getString(ARG_PARAM2); - } - mMMKV = MMKV.defaultMMKV(); - } - - @Override - public void onConfigurationChanged(@NonNull Configuration newConfig) { - super.onConfigurationChanged(newConfig); - } - - @Override - public void fetchData() { - Log.e(TAG, "fetchData: "); - RemoteManager.getInstance().getLocation(); - initData(); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - // Inflate the layout for this fragment - rootView = inflater.inflate(R.layout.fragment_custom, container, false); - mContext = (Activity) rootView.getContext(); - mCustomPresenter = new CustomPresenter(mContext); - mCustomPresenter.attachView(this); - mCustomPresenter.setLifecycle(lifecycleSubject); - mCacheHelper = new CacheHelper(mContext); - mCRv = mContext.getContentResolver(); - ButterKnife.bind(this, rootView); - initView(); - return rootView; - } - - private void initView() { - Log.e(TAG, "initView: " + Utils.getBatteryLevel(mContext)); - registerBatteryReceiver(); - registerAlarmClockReceiver(); - registTimeReceiver(); - tv_time.setText(DataUtil.formatDateDay() + "\t" + getWeek()); - mContext.registerReceiver(mbatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); - if (Settings.Global.getInt(mCRv, "is_aihealth", 0) == 1) { - cl_appstore.setVisibility(View.GONE); - cl_ai.setVisibility(View.VISIBLE); - } else { - cl_appstore.setVisibility(View.VISIBLE); - cl_ai.setVisibility(View.GONE); - } -// tv_battery.setText(Utils.getBatteryLevel(mContext) + "%"); - cpv.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - killBackgroundApp(); - } - }); -// cl_alarm.setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View v) { -// ApkUtils.openPackage(mContext, "com.alarmclock.uiui"); -// } -// }); - cl_guard.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (checkExpired()) { - showExpired(); - } else { - } - } - }); -// notificationAdapter = new NotificationAdapter(); -// notificationAdapter.setOnClickListener(new NotificationAdapter.OnClickListener() { -// @Override -// public void onClick() { -// getAlarm(); -// } -// }); -// rv_noti.setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View view) { -// getAlarm(); -// } -// }); -// rv_noti.setLayoutManager(new LinearLayoutManager(mContext)); -// rv_noti.setAdapter(notificationAdapter); - if (isWifiConnect()) { -// wifi_ssid.setText(getConnectWifiSsid()); - } else { -// wifi_ssid.setText("WiFi未连接"); - } - cl_sos.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (checkExpired()) { - showExpired(); - } else { - } - } - }); - cl_weather.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (checkExpired()) { - showExpired(); - } else { - - } - } - }); - cl_activation.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - ApkUtils.openApp(mContext, "com.uiui.sn"); - } - }); - cl_clean.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (checkExpired()) { - showExpired(); - } else { - killBackgroundApp(); - } - } - }); - cl_health.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - } - }); - cl_contact.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (checkExpired()) { - showExpired(); - } else { - } - } - }); - cl_ai.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (checkExpired()) { - showExpired(); - } else { - } - } - }); - cl_app.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (checkExpired()) { - showExpired(); - } else { - - } - } - }); - cl_app.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View view) { - return false; - } - }); - cl_appstore.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - if (checkExpired()) { - showExpired(); - } else { - ApkUtils.openApp(mContext, "com.uiui.appstore"); - } - } - }); - refreshMemory(); - } - - /** - * 检查wifi是否处开连接状态 - * - * @return - */ - public boolean isWifiConnect() { - ConnectivityManager connManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); - NetworkInfo mWifiInfo = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); - return mWifiInfo.isConnected(); - } - - private void showExpired() { - SingleDialog dialog = new SingleDialog(mContext); - dialog.setTitle("温馨提示") - .setMessage("体验时间已到期,请激活") - .setPositive("确定") -// .setNegtive("拒绝") -// .setSingle(true) - .setOnClickBottomListener(new SingleDialog.OnClickBottomListener() { - @Override - public void onPositiveClick() { - ApkUtils.openApp(mContext, "com.uiui.sn"); - dialog.dismiss(); - } - }); - dialog.show(); - } - - public interface Activation { - void ActivationCallback(); - } - - private boolean checkExpired() { - int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0); - int code_type = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_CODE_TYPE_KEY, -1); - long expire_time = Settings.Global.getLong(mContext.getContentResolver(), CommonConfig.UIUI_EXPIRE_TIME_KEY, -1); - if (is_activation == 0) { - return true; - } else if (is_activation == 1) { - if (code_type == 0) { - if (expire_time > 0) { - long time = System.currentTimeMillis() / 1000; - return time > expire_time; - } else { - return true; - } - } else if (code_type == 1) { - return false; - } else { - return true; - } - } else { - return true; - } - } - - private void initData() { - mCustomPresenter.getSnIsActivation(); - initAmap(); - } - - @Override - public void setNetSnIsActivation(boolean activation) { - if (activation) { - cl_weather.setVisibility(View.VISIBLE); - cl_activation.setVisibility(View.GONE); - } else { - cl_weather.setVisibility(View.GONE); - cl_activation.setVisibility(View.VISIBLE); - } - mCustomPresenter.getSnInfo(); - } - - @Override - public void setSnIsActivation(boolean activation) { - if (activation) { - cl_weather.setVisibility(View.VISIBLE); - cl_activation.setVisibility(View.GONE); - } else { - cl_weather.setVisibility(View.GONE); - cl_activation.setVisibility(View.VISIBLE); - } - } - - @Override - public void setSnInfo(SnInfo snInfo) { - if (snInfo != null) { - if (TextUtils.isEmpty(snInfo.getSn_name())) { -// tv_name.setText("未设置"); - } else { -// tv_name.setText(snInfo.getSn_name()); - } - } else { -// tv_name.setText("未设置"); - } - mCustomPresenter.getUserAvatarInfo(); - } - - @Override - public void setUserAvatarInfo(UserAvatarInfo userAvatarInfo) { - if (userAvatarInfo != null && userAvatarInfo.getAvatar() != null) { - if (!mContext.isDestroyed()) { -// Glide.with(iv_head).load(userAvatarInfo.getAvatar()).into(iv_head); - } - } - mCustomPresenter.getAlarmClock(); - } - - @Override - public void setAlarmClock(List clockDataList) { - - } - - @Override - public void onStart() { - super.onStart(); - } - - @Override - public void onPause() { - super.onPause(); - } - - @Override - public void onResume() { - super.onResume(); - mCustomPresenter.getSnIsActivation(); - } - - - private void initAmap() { - String city = RemoteManager.getInstance().getCity(); - tv_location.setText(city); - } - - private void showNoData(String title, String msg) { - SingleDialog dialog = new SingleDialog(mContext); - dialog.setTitle(title) - .setMessage(msg) - .setPositive("确定") -// .setNegtive("拒绝") -// .setSingle(true) - .setOnClickBottomListener(new SingleDialog.OnClickBottomListener() { - @Override - public void onPositiveClick() { - dialog.dismiss(); - } - }); -// dialog.setCancelable(false); - dialog.show(); - } - - private void killBackgroundApp() { - List pkgList = ApkUtils.queryFilterAppList(mContext); - for (String pkg : pkgList) { - if (pkg.equalsIgnoreCase(BuildConfig.APPLICATION_ID) - || "com.tencent.mm".equals(pkg)) { - continue; - } - killBackgroundProcesses(pkg); - } - refreshMemory(); - } - - private void killBackgroundProcesses(String packageName) { - ActivityManager activityManager; - try { - activityManager = (ActivityManager) - mContext.getSystemService(Context.ACTIVITY_SERVICE); - activityManager.killBackgroundProcesses(packageName); - Method forceStopPackage = activityManager.getClass() - .getDeclaredMethod("forceStopPackage", String.class); -// Log.e(TAG, "killBackgroundProcesses: " + packageName); - forceStopPackage.setAccessible(true); - forceStopPackage.invoke(activityManager, packageName); - } catch (Exception e) { - Log.e(TAG, "killBackgroundProcesses: " + e.getMessage()); - e.printStackTrace(); - } - } - - private void refreshMemory() { - long avail = AppUtil.getAvailMemory(mContext); - long total = AppUtil.getTotalMemory(mContext); - int x = (int) (((total - avail) / (double) total) * 100); - if (x > 80) { - cpv.setProgressColor(mShaderColorsRed); - } else { - cpv.setProgressColor(mShaderColors); - } - cpv.showAnimation(0, x, 1000); - float x2 = (((total - avail) / (float) total)); - } - - - private void registerAlarmClockReceiver() { - if (null == mAlarmClockReceiver) { - mAlarmClockReceiver = new AlarmClockReceiver(); - } - IntentFilter filter = new IntentFilter(); - filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); - filter.addAction(MessageReceiver.SET_ALARMCLOCK); - mContext.registerReceiver(mAlarmClockReceiver, filter); - } - - private AlarmClockReceiver mAlarmClockReceiver; - - private class AlarmClockReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - Log.e(TAG, "onReceive: " + action); - if (MessageReceiver.SET_ALARMCLOCK.equals(action)) { - Handler.getMain().postDelayed(new Runnable() { - @Override - public void run() { - mCustomPresenter.getAlarmClock(); - } - }, 3456); - } - } - } - - private void registerBatteryReceiver() { - if (null == batteryReceiver) { - batteryReceiver = new BatteryReceiver(); - } - IntentFilter filter = new IntentFilter(); - filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); - filter.addAction(Intent.ACTION_BATTERY_CHANGED); - filter.addAction(Intent.ACTION_BATTERY_LOW); - filter.addAction(Intent.ACTION_BATTERY_OKAY); - filter.addAction(Intent.ACTION_POWER_CONNECTED); - filter.addAction(Intent.ACTION_POWER_DISCONNECTED); - mContext.registerReceiver(batteryReceiver, filter); - } - - private BatteryReceiver batteryReceiver; - - private class BatteryReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { - // 当前电量 - int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); - // 最大电量 - int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, 0); - int elec = (level * 100) / scale; - Log.i(TAG, "electricity:=" + elec + "%"); -// tv_battery.setText(elec + "%"); - } else if (Intent.ACTION_POWER_CONNECTED.equals(action) - || Intent.ACTION_POWER_DISCONNECTED.equals(action) - || Intent.ACTION_BATTERY_LOW.equals(action) - || Intent.ACTION_BATTERY_OKAY.equals(action) - ) { - - } - } - } - - private BroadcastReceiver mbatteryReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - Log.i(TAG, "onReceive: " + action); - if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { - int status = intent.getIntExtra("status", BatteryManager.BATTERY_STATUS_UNKNOWN); - if (status == BatteryManager.BATTERY_STATUS_CHARGING) { - if (rootView != null) { -// iv_charging.setVisibility(View.VISIBLE); - } - } else { - if (rootView != null) { -// iv_charging.setVisibility(View.GONE); - } - } - } - } - }; - - /** - * 时间 - */ - private void registTimeReceiver() { - if (null == mTimeReceiver) { - mTimeReceiver = new TimeReceiver(); - } - IntentFilter filter = new IntentFilter(); - filter.addAction(Intent.ACTION_DATE_CHANGED); - filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); - filter.addAction(Intent.ACTION_TIME_CHANGED); - filter.addAction(Intent.ACTION_TIME_TICK); - mContext.registerReceiver(mTimeReceiver, filter); - } - - private void unRegistTimeReceiver() { - if (null != mTimeReceiver) { - mContext.unregisterReceiver(mTimeReceiver); - } - } - - private TimeReceiver mTimeReceiver; - - class TimeReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - if (action.equals(Intent.ACTION_DATE_CHANGED) - || action.equals(Intent.ACTION_TIMEZONE_CHANGED) - || action.equals(Intent.ACTION_TIME_CHANGED) - || action.equals(Intent.ACTION_TIME_TICK) - ) { - tv_time.setText(DataUtil.formatDateDay() + "\t" + getWeek()); - } - } - } - - // 根据日期取得星期几 - public static String getWeek() { - Date date = new Date(); - String[] weeks = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"}; - Calendar cal = Calendar.getInstance(); - cal.setTime(date); - int weekIndex = cal.get(Calendar.DAY_OF_WEEK) - 1; - if (weekIndex < 0) { - weekIndex = 0; - } - return weeks[weekIndex]; - } - - @Override - public void onDestroy() { - super.onDestroy(); - mCustomPresenter.detachView(); - NetworkUtils.unregisterNetworkStatusChangedListener(this); - if (batteryReceiver != null) { - mContext.unregisterReceiver(batteryReceiver); - } - if (mbatteryReceiver != null) { - mContext.unregisterReceiver(mbatteryReceiver); - } - if (mAlarmClockReceiver != null) { - mContext.unregisterReceiver(mAlarmClockReceiver); - } - unRegistTimeReceiver(); - } -} diff --git a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomPresenter.java b/app/src/main/java/com/uiui/zyos/fragment/custom/CustomPresenter.java deleted file mode 100644 index 26dc9dd..0000000 --- a/app/src/main/java/com/uiui/zyos/fragment/custom/CustomPresenter.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.uiui.zyos.fragment.custom; - -import android.content.Context; -import android.provider.Settings; - -import com.trello.rxlifecycle4.android.FragmentEvent; -import com.uiui.zyos.config.CommonConfig; - -import io.reactivex.rxjava3.annotations.NonNull; -import io.reactivex.rxjava3.subjects.BehaviorSubject; - -public class CustomPresenter implements CustomContact.Presenter { - private static final String TAG = CustomPresenter.class.getSimpleName(); - private Context mContext; - private CustomContact.CustomView mView; - - public CustomPresenter(Context context) { - this.mContext = context; - } - - private BehaviorSubject lifecycle; - - void setLifecycle(BehaviorSubject lifecycle) { - this.lifecycle = lifecycle; - } - - public BehaviorSubject getLifecycle() { - return lifecycle; - } - - @Override - public void attachView(@NonNull CustomContact.CustomView view) { - this.mView = view; - } - - @Override - public void detachView() { - this.mView = null; - } - - @Override - public void getNetSnIsActivation() { -// NetInterfaceManager.getInstance() -// .getSnIsActivationObservable() -// .compose(RxLifecycle.bindUntilEvent(lifecycle, FragmentEvent.DESTROY)) -// .subscribe(new Observer() { -// @Override -// public void onSubscribe(@NonNull Disposable d) { -// Log.e("getSnIsActivation", "onSubscribe: "); -// } -// -// @Override -// public void onNext(@NonNull BaseResponse baseResponse) { -// Log.e("getSnIsActivation", "onNext: " + baseResponse); -// if (baseResponse.code == 200) { -// JsonObject jsonObject = GsonUtils.getJsonObject(baseResponse.data.toString()); -// int is_activation = jsonObject.get("is_activation").getAsInt(); -// Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, is_activation); -// mView.setNetSnIsActivation(is_activation == 1); -// } else { -// mView.setNetSnIsActivation(false); -// } -// } -// -// @Override -// public void onError(@NonNull Throwable e) { -// Log.e("getSnIsActivation", "onError: " + e.getMessage()); -// int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0); -// mView.setNetSnIsActivation(is_activation == 1); -// onComplete(); -// } -// -// @Override -// public void onComplete() { -// Log.e("getSnIsActivation", "onComplete: "); -// } -// }); - } - - @Override - public void getSnIsActivation() { - int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0); - mView.setSnIsActivation(is_activation == 1); - } - - @Override - public void getSnInfo() { - mView.setSnInfo(null); - } - - @Override - public void getUserAvatarInfo() { - mView.setUserAvatarInfo(null); - } - - @Override - public void getAlarmClock() { -// NetInterfaceManager.getInstance().getAlarmClockFragment(lifecycle, new NetInterfaceManager.AlarmClockCallback() { -// @Override -// public void setAlarmClock(List alarmClockList) { -// AlarmClockData alarmClockData = AlarmUtils.getInstance().getRecentAlarmClock(); -// if (alarmClockData != null) { -// List data = new ArrayList<>(); -// data.add(alarmClockData); -// mView.setAlarmClock(data); -// } else { -// mView.setAlarmClock(null); -// } -// } -// -// @Override -// public void setAlarmClockEmpty() { -// mView.setAlarmClock(null); -// } -// -// @Override -// public void onError() { -// -// } -// }); - mView.setAlarmClock(null); - } - -} diff --git a/app/src/main/java/com/uiui/zyos/fragment/english/EnglishFragment.java b/app/src/main/java/com/uiui/zyos/fragment/english/EnglishFragment.java new file mode 100644 index 0000000..b92ade9 --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/english/EnglishFragment.java @@ -0,0 +1,65 @@ +package com.uiui.zyos.fragment.english; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.uiui.zyos.R; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link EnglishFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class EnglishFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public EnglishFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment EnglishFragment. + */ + // TODO: Rename and change types and number of parameters + public static EnglishFragment newInstance(String param1, String param2) { + EnglishFragment fragment = new EnglishFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_english, container, false); + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/math/MathFragment.java b/app/src/main/java/com/uiui/zyos/fragment/math/MathFragment.java new file mode 100644 index 0000000..6a701b5 --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/math/MathFragment.java @@ -0,0 +1,65 @@ +package com.uiui.zyos.fragment.math; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.uiui.zyos.R; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link MathFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class MathFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public MathFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment MathFragment. + */ + // TODO: Rename and change types and number of parameters + public static MathFragment newInstance(String param1, String param2) { + MathFragment fragment = new MathFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_math, container, false); + } +} diff --git a/app/src/main/java/com/uiui/zyos/fragment/physics/PhysicsFragment.java b/app/src/main/java/com/uiui/zyos/fragment/physics/PhysicsFragment.java new file mode 100644 index 0000000..3a99406 --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/fragment/physics/PhysicsFragment.java @@ -0,0 +1,65 @@ +package com.uiui.zyos.fragment.physics; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.uiui.zyos.R; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link PhysicsFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class PhysicsFragment extends Fragment { + // TODO: Rename parameter arguments, choose names that match + // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER + private static final String ARG_PARAM1 = "param1"; + private static final String ARG_PARAM2 = "param2"; + + // TODO: Rename and change types of parameters + private String mParam1; + private String mParam2; + + public PhysicsFragment() { + // Required empty public constructor + } + + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment PhysicsFragment. + */ + // TODO: Rename and change types and number of parameters + public static PhysicsFragment newInstance(String param1, String param2) { + PhysicsFragment fragment = new PhysicsFragment(); + Bundle args = new Bundle(); + args.putString(ARG_PARAM1, param1); + args.putString(ARG_PARAM2, param2); + fragment.setArguments(args); + return fragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_physics, container, false); + } +} diff --git a/app/src/main/java/com/uiui/zyos/manager/RemoteManager.java b/app/src/main/java/com/uiui/zyos/manager/RemoteManager.java index cc6c55a..19f6c0b 100644 --- a/app/src/main/java/com/uiui/zyos/manager/RemoteManager.java +++ b/app/src/main/java/com/uiui/zyos/manager/RemoteManager.java @@ -14,8 +14,7 @@ import com.google.gson.reflect.TypeToken; import com.tencent.mmkv.MMKV; import com.uiui.zyos.bean.MapBean; import com.uiui.zyos.config.CommonConfig; -import com.uiui.zyos.disklrucache.CacheHelper; -import com.uiui.sn.IGetInfoInterface; +import com.uiui.zysn.IGetInfoInterface; import java.lang.reflect.Type; @@ -26,30 +25,33 @@ public class RemoteManager { private static RemoteManager sInstance; private Context mContext; private MMKV mMMKV = MMKV.defaultMMKV(); - private CacheHelper mCacheHelper; - private IGetInfoInterface getInfoInterface; - private ServiceConnection mIGetInfoConnection; + private IGetInfoInterface mGetInfoInterface; + private ServiceConnection mServiceConnection; + private static final String SN_AIDL_NAME = "com.uiui.zysn.IGetInfoInterface"; + private static final String SN_PACKAGE_NAME = "com.uiui.zysn"; + private static final String SN_SERVICE_NAME = "com.uiui.zysn.service.RemoteService"; private RemoteManager(Context context) { if (context == null) { throw new RuntimeException("Context is NULL"); } this.mContext = context; - this.mCacheHelper = new CacheHelper(context); - mIGetInfoConnection = new ServiceConnection() { + mServiceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName name, IBinder service) { Log.e(TAG, "onServiceConnected: mIGetInfoConnection"); - getInfoInterface = IGetInfoInterface.Stub.asInterface(service); + mGetInfoInterface = IGetInfoInterface.Stub.asInterface(service); getLocation(); + Log.e(TAG, "onServiceConnected: " + getSerial()); } @Override public void onServiceDisconnected(ComponentName name) { Log.e(TAG, "onServiceDisconnected: mIGetInfoConnection"); - getInfoInterface = null; + //置空,重连 + mGetInfoInterface = null; bindInfoService(); } }; @@ -71,20 +73,36 @@ public class RemoteManager { } private void bindInfoService() { - if (getInfoInterface == null) { + if (mGetInfoInterface == null) { //这是连接aidl服务的代码 Intent intent = new Intent(); - intent.setAction("com.uiui.sn.IGetInfoInterface"); - intent.setPackage("com.uiui.sn"); - intent.setComponent(new ComponentName("com.uiui.sn", "com.uiui.sn.service.RemoteService")); - mContext.bindService(intent, mIGetInfoConnection, Context.BIND_AUTO_CREATE); + intent.setAction(SN_AIDL_NAME); + intent.setPackage(SN_PACKAGE_NAME); + intent.setComponent(new ComponentName(SN_PACKAGE_NAME, SN_SERVICE_NAME)); + mContext.bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE); } } - public void getLocation() { - if (getInfoInterface != null) { + /** + * @return 获取sn + */ + public String getSerial() { + if (mGetInfoInterface != null) { try { - String jsonString = getInfoInterface.getMapResult(); + return mGetInfoInterface.getSerial(); + } catch (Exception e) { + Log.e(TAG, "getSerial: " + e.getMessage()); + } + } else { + bindInfoService(); + } + return "unknown"; + } + + public void getLocation() { + if (mGetInfoInterface != null) { + try { + String jsonString = mGetInfoInterface.getMapResult(); mMMKV.encode(CommonConfig.MAP_LOCATION_JSON_KEY, jsonString); } catch (Exception e) { Log.e(TAG, "getMapResult: " + e.getMessage()); @@ -120,14 +138,13 @@ public class RemoteManager { } } - public String getCityDistrict() { MapBean mapBean = getMapBean(); if (mapBean == null) { getLocation(); return "北京"; } else { - return mapBean.getCity() + "\t" + mapBean.getDistrict(); + return mapBean.getCity() + "\t" + mapBean.getDistrict(); } } @@ -157,9 +174,7 @@ public class RemoteManager { getLocation(); return "0.0"; } else { - return mapBean.getLongitude() + "," + mapBean.getLatitude(); + return mapBean.getLongitude() + "," + mapBean.getLatitude(); } } - - } diff --git a/app/src/main/java/com/uiui/zyos/utils/ApkUtils.java b/app/src/main/java/com/uiui/zyos/utils/ApkUtils.java index 277f451..e946d7f 100644 --- a/app/src/main/java/com/uiui/zyos/utils/ApkUtils.java +++ b/app/src/main/java/com/uiui/zyos/utils/ApkUtils.java @@ -63,7 +63,7 @@ public class ApkUtils { }}; private static HashSet showPackageName = new HashSet() {{ - this.add("com.uiui.sn"); + this.add("com.uiui.zysn"); this.add("com.android.dialer"); this.add("com.android.gallery3d"); this.add("com.android.settings"); @@ -144,7 +144,7 @@ public class ApkUtils { this.add("com.android.gallery3d"); this.add("com.android.camera2"); this.add("com.android.settings"); - this.add("com.uiui.sn"); + this.add("com.uiui.zysn"); this.add("com.uiui.appstore"); }}; @@ -200,7 +200,7 @@ public class ApkUtils { } if (Settings.Global.getInt(context.getContentResolver(), "is_activity", 0) == 0) { resolveInfos.removeIf(resolveInfo -> "com.uiui.city".equals(resolveInfo.activityInfo.packageName)); -// resolveInfos.removeIf(applicationInfo -> "com.uiui.sn".equals(applicationInfo.packageName)); +// resolveInfos.removeIf(applicationInfo -> "com.uiui.zysn".equals(applicationInfo.packageName)); } resolveInfos.sort(new Comparator() { @Override diff --git a/app/src/main/java/com/uiui/zyos/utils/AppUsedTimeUtils.java b/app/src/main/java/com/uiui/zyos/utils/AppUsedTimeUtils.java deleted file mode 100644 index 84b8e8f..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/AppUsedTimeUtils.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.uiui.zyos.utils; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.provider.Settings; -import android.text.TextUtils; -import android.util.Log; - -import androidx.annotation.NonNull; - -import com.google.gson.Gson; -import com.google.gson.JsonParser; -import com.google.gson.reflect.TypeToken; - -import java.io.Serializable; -import java.lang.reflect.Type; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -public class AppUsedTimeUtils { - private static final String TAG = AppUsedTimeUtils.class.getSimpleName(); - - @SuppressLint("StaticFieldLeak") - private static AppUsedTimeUtils sInstance; - private Context mContext; - - private SimpleDateFormat ruleSDF = new SimpleDateFormat("HH:mm:ss"); - private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - - private AppTimeinfo appTimeinfo; - - private AppUsedTimeUtils(Context context) { - this.mContext = context; - appTimeinfo = getAppTimeinfo(); - } - - public static void init(Context context) { - if (sInstance == null) { - sInstance = new AppUsedTimeUtils(context); - } - } - - public static AppUsedTimeUtils getInstance() { - if (sInstance == null) { - throw new IllegalStateException("You must be init TimeUtils first"); - } - return sInstance; - } - - private static String normalStartTime = "8:00:00"; - private static String unusualStartTime = "22:00:00"; - - static class AppTimeinfo implements Serializable { - private static final long serialVersionUID = 5373751133823666192L; - - AppTimeinfo() { - this.appPackageName = ""; - this.endTime = 0; - this.startTime = 0; - } - - private String appPackageName; - private long endTime; - private long startTime; - - public String getAppPackageName() { - return appPackageName; - } - - public void setAppPackageName(String appPackageName) { - this.appPackageName = appPackageName; - } - - public long getEndTime() { - return endTime; - } - - public void setEndTime(long endTime) { - this.endTime = endTime; - } - - public long getStartTime() { - return startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - @NonNull - @Override - public String toString() { - return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString(); - } - } - - synchronized public void setAppPackageName(String name) { - appTimeinfo.setAppPackageName(name); - setAppTimeinfo(); - } - - synchronized public String getAppPackageName() { - return appTimeinfo.getAppPackageName(); - } - - synchronized public void setStartTime(long time) { - appTimeinfo.setStartTime(time); - setAppTimeinfo(); - } - - synchronized public long getStartTime() { - return appTimeinfo.getStartTime(); - } - - synchronized public void setEndTime(long time) { - appTimeinfo.setEndTime(time); - setAppTimeinfo(); - } - - synchronized public long getEndTime() { - return appTimeinfo.getEndTime(); - } - - synchronized private AppTimeinfo getAppTimeinfo() { - String jsonString = Settings.System.getString(mContext.getContentResolver(), "runningAppInfo"); - if (TextUtils.isEmpty(jsonString)) { - return new AppTimeinfo(); - } - Log.e(TAG, "getAppTimeinfo: " + jsonString); - Type type = new TypeToken() { - }.getType(); - Gson gson = new Gson(); - AppTimeinfo appTimeinfo = gson.fromJson(jsonString, type); - return appTimeinfo; - } - - synchronized private void setAppTimeinfo() { - String jsonString = JsonParser.parseString(appTimeinfo.toString()).getAsJsonObject().toString(); - Settings.System.putString(mContext.getContentResolver(), "runningAppInfo", jsonString); - } - - private static final long DAY_TIME = 1000 * 60 * 60 * 24; - - public boolean isNormalTime() { - long nowTime = System.currentTimeMillis(); - String nowTimeString = ruleSDF.format(new Date(nowTime)); // 时间戳转换日期 - try { - Date startDate = ruleSDF.parse(normalStartTime); - Date endDate = ruleSDF.parse(unusualStartTime); - Date now = ruleSDF.parse(nowTimeString); - Log.e(TAG, "isScreenshot: startDate = " + startDate); - Log.e(TAG, "isScreenshot: endDate = " + endDate); - Log.e(TAG, "isScreenshot: now = " + now); - if (startDate.getTime() <= now.getTime() && now.getTime() <= endDate.getTime()) { - return true; - } else if (endDate.getTime() < now.getTime() && now.getTime() <= startDate.getTime() + DAY_TIME) { - return false; - } - } catch (ParseException e) { - e.printStackTrace(); - Log.e(TAG, "isScreenshot: " + e.getMessage()); - } - return false; - } - - -} diff --git a/app/src/main/java/com/uiui/zyos/utils/AppUtil.java b/app/src/main/java/com/uiui/zyos/utils/AppUtil.java deleted file mode 100644 index 4e0a519..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/AppUtil.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2012 www.amsoft.cn - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.uiui.zyos.utils; - - -import android.app.ActivityManager; -import android.content.Context; -import android.util.Log; - -import java.io.BufferedReader; -import java.io.FileReader; - -public class AppUtil { - private static String TAG = AppUtil.class.getSimpleName(); - - /** - * 描述:获取可用内存. - * - * @param context - * @return - */ - public static long getAvailMemory(Context context) { - // 获取android当前可用内存大小 - ActivityManager activityManager = (ActivityManager) context - .getSystemService(Context.ACTIVITY_SERVICE); - ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); - activityManager.getMemoryInfo(memoryInfo); - // 当前系统可用内存 ,将获得的内存大小规格化 - - return memoryInfo.availMem; - } - - /** - * @param context - * @return 可用的内存大小 - */ - public static long getFreeMemory(Context context) { - ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); - ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); - activityManager.getMemoryInfo(memoryInfo); - long freeMem = memoryInfo.totalMem - memoryInfo.availMem; -// Log.e("getHardware", "getFreeMemory: " + freeMem); - return freeMem; - } - - /** - * 描述:总内存. - * - * @param context - * @return - */ - public static long getTotalMemory(Context context) { - // 系统内存信息文件 - String file = "/proc/meminfo"; - String memInfo; - String[] strs; - long memory = 0; - - try { - FileReader fileReader = new FileReader(file); - BufferedReader bufferedReader = new BufferedReader(fileReader, 8192); - // 读取meminfo第一行,系统内存大小 - memInfo = bufferedReader.readLine(); - strs = memInfo.split("\\s+"); - for (String str : strs) { - Log.e(TAG, "getTotalMemory: " + str + "\t"); - } - // 获得系统总内存,单位KB - memory = Integer.valueOf(strs[1]).intValue(); - bufferedReader.close(); - } catch (Exception e) { - e.printStackTrace(); - } - // Byte转位KB或MB - return memory * 1024; - } - -} diff --git a/app/src/main/java/com/uiui/zyos/utils/BitmapUtils.java b/app/src/main/java/com/uiui/zyos/utils/BitmapUtils.java deleted file mode 100644 index 6ce1589..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/BitmapUtils.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.uiui.zyos.utils; - -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.PixelFormat; -import android.graphics.drawable.AdaptiveIconDrawable; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; -import android.os.Build; - -import java.io.ByteArrayOutputStream; - -public class BitmapUtils { - public static Bitmap Bytes2Bimap(byte[] b) { - if (b.length != 0) { - return BitmapFactory.decodeByteArray(b, 0, b.length); - } else { - return null; - } - } - - public static byte[] Bitmap2Bytes(Bitmap bitmap) { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos); - byte[] data = baos.toByteArray(); - return data; - } - - /** - * Drawable转换成一个Bitmap - * - * @param drawable drawable对象 - * @return - */ - public static final Bitmap drawableToBitmap(Drawable drawable) { - Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), - drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565); - Canvas canvas = new Canvas(bitmap); - drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); - drawable.draw(canvas); - return bitmap; - } - - - public static Bitmap drawableToBitamp(Drawable drawable) { - Bitmap bitmap; - BitmapDrawable bd = (BitmapDrawable) drawable; - bitmap = bd.getBitmap(); - return bitmap; - } - - public static Bitmap getIconBitmap(Context context, Drawable drawable) { - try { - if (drawable == null) { - return null; - } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && drawable instanceof AdaptiveIconDrawable) { - Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bitmap); - drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); - drawable.draw(canvas); - return Utils.getRoundedBitmap(bitmap, context); - } else { - return Utils.getRoundedBitmap(((BitmapDrawable) drawable).getBitmap(), context); - } - } catch (Exception e) { - return null; - } - } -} diff --git a/app/src/main/java/com/uiui/zyos/utils/BrightnessUtils.java b/app/src/main/java/com/uiui/zyos/utils/BrightnessUtils.java deleted file mode 100644 index 5ad618f..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/BrightnessUtils.java +++ /dev/null @@ -1,142 +0,0 @@ - -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.uiui.zyos.utils; - -import android.util.MathUtils; - -public class BrightnessUtils { - - public static final int GAMMA_SPACE_MIN = 0; - public static final int GAMMA_SPACE_MAX = 65535; - - // Hybrid Log Gamma constant values - private static final float R = 0.5f; - private static final float A = 0.17883277f; - private static final float B = 0.28466892f; - private static final float C = 0.55991073f; - - /** - * A function for converting from the gamma space that the slider works in to the - * linear space that the setting works in. - *

- * The gamma space effectively provides us a way to make linear changes to the slider that - * result in linear changes in perception. If we made changes to the slider in the linear space - * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law). - *

- * Internally, this implements the Hybrid Log Gamma electro-optical transfer function, which is - * a slight improvement to the typical gamma transfer function for displays whose max - * brightness exceeds the 120 nit reference point, but doesn't set a specific reference - * brightness like the PQ function does. - *

- * Note that this transfer function is only valid if the display's backlight value is a linear - * control. If it's calibrated to be something non-linear, then a different transfer function - * should be used. - * - * @param val The slider value. - * @param min The minimum acceptable value for the setting. - * @param max The maximum acceptable value for the setting. - * @return The corresponding setting value. - */ - public static final int convertGammaToLinear(int val, int min, int max) { - final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); - final float ret; - if (normalizedVal <= R) { - ret = MathUtils.sq(normalizedVal / R); - } else { - ret = MathUtils.exp((normalizedVal - C) / A) + B; - } - - // HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1] - // in order to derive the correct setting value. - return Math.round(MathUtils.lerp(min, max, ret / 12)); - } - - /** - * Version of {@link #convertGammaToLinear} that takes and returns float values. - * TODO(flc): refactor Android Auto to use float version - * - * @param val The slider value. - * @param min The minimum acceptable value for the setting. - * @param max The maximum acceptable value for the setting. - * @return The corresponding setting value. - */ - public static final float convertGammaToLinearFloat(int val, float min, float max) { - final float normalizedVal = MathUtils.norm(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, val); - final float ret; - if (normalizedVal <= R) { - ret = MathUtils.sq(normalizedVal / R); - } else { - ret = MathUtils.exp((normalizedVal - C) / A) + B; - } - - // HLG is normalized to the range [0, 12], ensure that value is within that range, - // it shouldn't be out of bounds. - final float normalizedRet = MathUtils.constrain(ret, 0, 12); - - // Re-normalize to the range [0, 1] - // in order to derive the correct setting value. - return MathUtils.lerp(min, max, normalizedRet / 12); - } - - /** - * A function for converting from the linear space that the setting works in to the - * gamma space that the slider works in. - *

- * The gamma space effectively provides us a way to make linear changes to the slider that - * result in linear changes in perception. If we made changes to the slider in the linear space - * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law). - *

- * Internally, this implements the Hybrid Log Gamma opto-electronic transfer function, which is - * a slight improvement to the typical gamma transfer function for displays whose max - * brightness exceeds the 120 nit reference point, but doesn't set a specific reference - * brightness like the PQ function does. - *

- * Note that this transfer function is only valid if the display's backlight value is a linear - * control. If it's calibrated to be something non-linear, then a different transfer function - * should be used. - * - * @param val The brightness setting value. - * @param min The minimum acceptable value for the setting. - * @param max The maximum acceptable value for the setting. - * @return The corresponding slider value - */ - public static final int convertLinearToGamma(int val, int min, int max) { - return convertLinearToGammaFloat((float) val, (float) min, (float) max); - } - - /** - * Version of {@link #convertLinearToGamma} that takes float values. - * TODO: brightnessfloat merge with above method(?) - * - * @param val The brightness setting value. - * @param min The minimum acceptable value for the setting. - * @param max The maximum acceptable value for the setting. - * @return The corresponding slider value - */ - public static final int convertLinearToGammaFloat(float val, float min, float max) { - // For some reason, HLG normalizes to the range [0, 12] rather than [0, 1] - final float normalizedVal = MathUtils.norm(min, max, val) * 12; - final float ret; - if (normalizedVal <= 1f) { - ret = MathUtils.sqrt(normalizedVal) * R; - } else { - ret = A * MathUtils.log(normalizedVal - B) + C; - } - - return Math.round(MathUtils.lerp(GAMMA_SPACE_MIN, GAMMA_SPACE_MAX, ret)); - } -} diff --git a/app/src/main/java/com/uiui/zyos/utils/DataUtil.java b/app/src/main/java/com/uiui/zyos/utils/DataUtil.java deleted file mode 100644 index 5f6d362..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/DataUtil.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.uiui.zyos.utils; - -import java.text.SimpleDateFormat; -import java.util.Date; - -/** - * 作者 mjsheng - * 日期 2018/8/31 09:50 - * 邮箱 501802639@qq.com - * 来自: - */ - -public class DataUtil { - private static SimpleDateFormat day = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - private static SimpleDateFormat hour = new SimpleDateFormat("HH:mm"); - private static SimpleDateFormat minute = new SimpleDateFormat("mm"); - - /** - * 格式化日期(精确到天) - */ - public static String formatDateDay() { - return day.format(new Date()); - } - - /** - * 格式化日期(hour) - */ - public static String formatDateHour() { - return hour.format(new Date()); - } - - /** - * 格式化日期(minute) - */ - public static String formatDateMinute() { - return minute.format(new Date()); - } -} diff --git a/app/src/main/java/com/uiui/zyos/utils/DimenTool.java b/app/src/main/java/com/uiui/zyos/utils/DimenTool.java new file mode 100644 index 0000000..afd200f --- /dev/null +++ b/app/src/main/java/com/uiui/zyos/utils/DimenTool.java @@ -0,0 +1,183 @@ +package com.uiui.zyos.utils; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; + +/** + * Created by Administrator on 2016/11/25. + * 华为版本 sw480 的内容替换成sw400 + */ + +public class DimenTool { + + public static void gen() { + + File file = new File("./app/src/main/res/values/dimens.xml"); + BufferedReader reader = null; + StringBuilder sw320 = new StringBuilder(); + StringBuilder sw360 = new StringBuilder(); + StringBuilder sw400 = new StringBuilder(); + StringBuilder sw460 = new StringBuilder(); + StringBuilder sw480 = new StringBuilder(); + StringBuilder sw560 = new StringBuilder(); + StringBuilder sw600 = new StringBuilder(); + StringBuilder sw609 = new StringBuilder(); + StringBuilder sw640 = new StringBuilder(); + StringBuilder sw720 = new StringBuilder(); + StringBuilder sw760 = new StringBuilder(); + StringBuilder sw800 = new StringBuilder(); + StringBuilder sw860 = new StringBuilder(); + StringBuilder sw900 = new StringBuilder(); +// StringBuilder mdpi = new StringBuilder(); +// StringBuilder hdpi = new StringBuilder(); +// StringBuilder xhdpi = new StringBuilder(); +// StringBuilder xxhdpi = new StringBuilder(); + + + try { + System.out.println("生成不同分辨率:"); + reader = new BufferedReader(new FileReader(file)); + String tempString; + int line = 1; + // 一次读入一行,直到读入null为文件结束 + + java.text.DecimalFormat df = new java.text.DecimalFormat("#.##"); + while ((tempString = reader.readLine()) != null) { + + if (tempString.contains("")) { + //tempString = tempString.replaceAll(" ", ""); + String start = tempString.substring(0, tempString.indexOf(">") + 1); + String end = tempString.substring(tempString.lastIndexOf("<") - 2); + double num = Double.valueOf(tempString.substring(tempString.indexOf(">") + 1, tempString.indexOf("") - 2)); + + sw320.append(start).append(df.format((double) num * 0.4)).append(end).append("\n"); + sw360.append(start).append(df.format((double) num * 0.45)).append(end).append("\n"); + sw400.append(start).append(df.format((double) num * 0.5)).append(end).append("\n"); + sw460.append(start).append(df.format((double) num * 0.575)).append(end).append("\n"); + sw480.append(start).append(df.format((double) num * 0.6)).append(end).append("\n"); + + + sw560.append(start).append(df.format((double) num * 0.7)).append(end).append("\n"); + sw600.append(start).append(df.format((double) num * 0.75)).append(end).append("\n"); + sw609.append(start).append(df.format((double) num * 0.76125)).append(end).append("\n"); + sw640.append(start).append(df.format((double) num * 0.85)).append(end).append("\n"); // 适配学仕宝 + sw720.append(start).append(df.format((double) num * 0.9)).append(end).append("\n"); + sw760.append(start).append(df.format((double) num * 0.95)).append(end).append("\n"); + sw800.append(tempString).append("\n"); + sw860.append(start).append(df.format((double) num * 1.06)).append(end).append("\n"); + sw900.append(start).append(df.format((double) num * 1.125)).append(end).append("\n"); + +// mdpi.append(start).append(df.format((double) num * 0.75)).append(end).append("\n"); +// hdpi.append(start).append(df.format((double) num * 1)).append(end).append("\n"); +// xhdpi.append(start).append(df.format((double) num * 1.5)).append(end).append("\n"); +// xxhdpi.append(start).append(df.format((double) num * 2)).append(end).append("\n"); + + } else { + sw320.append(tempString).append("\n"); + sw360.append(tempString).append("\n"); + sw400.append(tempString).append("\n"); + sw460.append(tempString).append("\n"); + sw480.append(tempString).append("\n"); + sw560.append(tempString).append("\n"); + sw600.append(tempString).append("\n"); + sw609.append(tempString).append("\n"); + sw640.append(tempString).append("\n"); + sw760.append(tempString).append("\n"); + sw720.append(tempString).append("\n"); + sw800.append(tempString).append("\n"); + sw860.append(tempString).append("\n"); + sw900.append(tempString).append("\n"); +// mdpi.append(tempString).append("\n"); +// hdpi.append(tempString).append("\n"); +// xhdpi.append(tempString).append("\n"); +// xxhdpi.append(tempString).append("\n"); + } + line++; + } + reader.close(); + System.out.println(""); + System.out.println(sw480); + System.out.println(""); + System.out.println(sw600); + + System.out.println(""); + System.out.println(sw720); + System.out.println(""); + System.out.println(sw800); + + String sw320file = "./app/src/main/res/values-sw310dp/dimens.xml"; + String sw360file = "./app/src/main/res/values-sw350dp/dimens.xml"; + String sw400file = "./app/src/main/res/values-sw390dp/dimens.xml"; + String sw460file = "./app/src/main/res/values-sw450dp/dimens.xml"; + String sw480file = "./app/src/main/res/values-sw470dp/dimens.xml"; + String sw560file = "./app/src/main/res/values-sw550dp/dimens.xml"; + String sw600file = "./app/src/main/res/values-sw500dp/dimens.xml"; + String sw609file = "./app/src/main/res/values-sw609dp/dimens.xml"; + String sw640file = "./app/src/main/res/values-sw630dp/dimens.xml"; + String sw720file = "./app/src/main/res/values-sw710dp/dimens.xml"; + String sw760file = "./app/src/main/res/values-sw760dp/dimens.xml"; + String sw800file = "./app/src/main/res/values-sw800dp/dimens.xml"; + String sw860file = "./app/src/main/res/values-sw850dp/dimens.xml"; + String sw900file = "./app/src/main/res/values-sw890dp/dimens.xml"; +// String mdpifile = "./app/src/main/res/values-mdpi/dimens.xml"; +// String hdpifile = "./app/src/main/res/values-hdpi/dimens.xml"; +// String xhdpifile = "./app/src/main/res/values-xhdpi/dimens.xml"; +// String xxhdpifile = "./app/src/main/res/values-xxhdpi/dimens.xml"; + writeFile(sw320file, sw320.toString()); + writeFile(sw360file, sw360.toString()); + writeFile(sw400file, sw400.toString()); + writeFile(sw460file, sw460.toString()); + writeFile(sw480file, sw480.toString()); + writeFile(sw560file, sw560.toString()); + writeFile(sw600file, sw600.toString()); + + writeFile(sw609file, sw609.toString()); + + writeFile(sw640file, sw640.toString()); + writeFile(sw720file, sw720.toString()); + writeFile(sw760file, sw720.toString()); + writeFile(sw800file, sw800.toString()); + writeFile(sw860file, sw860.toString()); + writeFile(sw900file, sw900.toString()); +// writeFile(mdpifile, mdpi.toString()); +// writeFile(hdpifile, hdpi.toString()); +// writeFile(xhdpifile, xhdpi.toString()); +// writeFile(xxhdpifile, xxhdpi.toString()); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + } + } + + public static void writeFile(String file, String text) { + PrintWriter out = null; + try { + File file1 = new File(file.replace("/dimens.xml","").trim()); + if (!file1.exists()) { + file1.mkdirs(); + } + out = new PrintWriter(new BufferedWriter(new FileWriter(file))); + out.println(text); + } catch (IOException e) { + e.printStackTrace(); + } + + out.close(); + } + + public static void main(String[] args) { + gen(); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/uiui/zyos/utils/FileUtil.java b/app/src/main/java/com/uiui/zyos/utils/FileUtil.java deleted file mode 100644 index 8debaeb..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/FileUtil.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.uiui.zyos.utils; - -import android.text.TextUtils; - -import java.util.HashSet; - -public class FileUtil { - public static String getFileType(String url) { - if (url.indexOf("/") == -1) { - return url.substring(url.indexOf("."), url.length()); - } else { - String fileName = url.substring(url.lastIndexOf("/")); - return fileName.substring(fileName.indexOf("."), fileName.length()); - } - } - - private static HashSet videoFormat = new HashSet() {{ - this.add(".mp4"); - this.add(".avi"); - this.add(".nkv"); - this.add(".flv"); - }}; - private static HashSet pictureFormat = new HashSet() {{ - this.add(".png"); - this.add(".jpg"); - this.add(".jpeg"); - this.add(".bmp"); - }}; - - public static boolean isVideoFile(String fileName) { - if (TextUtils.isEmpty(fileName)) { - return false; - } else { - if (!fileName.startsWith(".")) { - return videoFormat.contains(getFileType(fileName)); - } else { - return videoFormat.contains(fileName); - } - } - } - - public static boolean isPictureFile(String fileName) { - if (TextUtils.isEmpty(fileName)) { - return false; - } else { - if (!fileName.startsWith(".")) { - return pictureFormat.contains(getFileType(fileName)); - } else { - return pictureFormat.contains(fileName); - } - } - } - -} diff --git a/app/src/main/java/com/uiui/zyos/utils/IconUtils.java b/app/src/main/java/com/uiui/zyos/utils/IconUtils.java deleted file mode 100644 index c4e50d9..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/IconUtils.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.uiui.zyos.utils; - -import android.util.Log; - -import java.util.ArrayList; -import java.util.List; - -public class IconUtils { - public static List appClassNameList = new ArrayList() {{ - this.add("com.uiui.sn");//设别信息 - this.add("com.uiui.appstore");//应用市场 - this.add("com.uiui.weather");//天气 - this.add("com.android.browser");//浏览器 - this.add("com.uiui.browser");//浏览器 - this.add("com.aoleyun.browser");//浏览器 - this.add("com.android.calculator2");//计算器 - this.add("com.android.calendar");//日历 - this.add("com.android.camera");//相机 - this.add("com.mediatek.camera");//相机 - this.add("com.android.camera2");//相机 - this.add("com.android.contacts");//通讯录 - this.add("com.android.deskclock");//时钟 - this.add("com.android.dialer");//电话 - this.add("com.android.dialer");//电话 - this.add("com.android.gallery3d");//图库 - this.add("com.android.mms");//信息 - this.add("com.android.mms.ui");//信息 - this.add("com.android.messaging");//信息 - this.add("com.android.music");//音乐 - this.add("com.android.providers.downloads.ui");//下载 - this.add("com.android.quicksearchbox");//搜索 - this.add("com.android.settings");//设置 - this.add("com.android.soundrecorder");//录音机 - this.add("com.android.stk.StkMain");//sim卡 - this.add("com.android.stk");//sim卡 - this.add("com.android.vdieo");//视频 - this.add("com.mediatek.filemanager");//文件管理 - this.add("com.android.documentsui");//下载 - this.add("com.mediatek.fmradio");//收音机 - this.add("com.android.fmradio");//收音机 - this.add("com.android.email");//电子邮件 -// this.add("com.ss.android.ugc.aweme");//抖音 -// this.add("com.ss.android.article.news");//头条 -// this.add("com.tencent.mm");//微信 - }}; - - public static List appIconList = new ArrayList() {{ - this.add("com_uiui_sn"); - this.add("com_android_appstore"); - this.add("com_uiui_weather"); - this.add("com_android_browser"); - this.add("com_android_browser"); - this.add("com_android_browser"); - this.add("com_android_calculator2"); - this.add("com_android_calendar"); - this.add("com_android_camera"); - this.add("com_android_camera"); - this.add("com_android_camera"); - this.add("com_android_contacts"); - this.add("com_android_deskclock"); - this.add("com_android_dialer"); - this.add("com_android_dialer"); - this.add("com_android_gallery3d_app"); - this.add("com_android_mms_ui"); - this.add("com_android_mms_ui"); - this.add("com_android_mms_ui"); - this.add("com_android_music"); - this.add("com_android_providers_downloads_ui"); - this.add("com_android_quicksearchbox"); - this.add("com_android_settings"); - this.add("com_android_soundrecorder"); - this.add("com_android_stk_stkmain"); - this.add("com_android_stk_stkmain"); - this.add("com_android_vdieo"); - this.add("com_mediatek_filemanager"); - this.add("com_mediatek_filemanager"); - this.add("com_mediatek_fmradio"); - this.add("com_mediatek_fmradio");//收音机 - this.add("com_android_email"); -// this.add("com_android_aweme2"); -// this.add("com_android_news2"); -// this.add("com_tencent_mm2"); - }}; - - public static List appIconList2 = new ArrayList() {{ - this.add("com_uiui_sn2"); - this.add("com_android_appstore2"); - this.add("com_uiui_weather2"); - this.add("com_android_browser2"); - this.add("com_android_browser2"); - this.add("com_android_browser2"); - this.add("com_android_calculator2"); - this.add("com_android_calendar"); - this.add("com_android_camera2"); - this.add("com_android_camera2"); - this.add("com_android_camera2"); - this.add("com_android_contacts"); - this.add("com_android_deskclock"); - this.add("com_android_dialer2"); - this.add("com_android_dialer2"); - this.add("com_android_gallery3d_app2"); - this.add("com_android_mms_ui2"); - this.add("com_android_mms_ui2"); - this.add("com_android_mms_ui2"); - this.add("com_android_music"); - this.add("com_android_providers_downloads_ui"); - this.add("com_android_quicksearchbox"); - this.add("com_android_settings2"); - this.add("com_android_soundrecorder"); - this.add("com_android_stk_stkmain"); - this.add("com_android_stk_stkmain"); - this.add("com_android_vdieo"); - this.add("com_mediatek_filemanager"); - this.add("com_mediatek_filemanager"); - this.add("com_mediatek_fmradio"); - this.add("com_mediatek_fmradio");//收音机 - this.add("com_android_email"); - this.add("com_android_aweme2"); - this.add("com_android_news2"); - this.add("com_tencent_mm2"); - }}; - - static { - Log.e("IconUtils", "appClassNameList size: " + appClassNameList.size()); - Log.e("IconUtils", "appIconList size: " + appIconList.size()); - Log.e("IconUtils", "appIconList2 size: " + appIconList2.size()); - } -} diff --git a/app/src/main/java/com/uiui/zyos/utils/LauncherUtils.java b/app/src/main/java/com/uiui/zyos/utils/LauncherUtils.java deleted file mode 100644 index ec2de76..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/LauncherUtils.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.uiui.zyos.utils; - -import android.app.role.RoleManager; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.os.Build; -import android.os.SystemProperties; -import android.os.UserHandle; -import android.text.TextUtils; -import android.util.Log; - -import java.util.List; -import java.util.concurrent.Executor; -import java.util.function.Consumer; - -public class LauncherUtils { - private static final String TAG = LauncherUtils.class.getSimpleName(); - - public static void openLauncher3(Context context) { - setDefaultDesktop(context, Launcher3, Launcher3Class); - if (!ApkUtils.openPackage(context, Launcher3)) { - setDefaultDesktop(context, Launcher3, Launcher3Class); - gotoLauncher(context); - } - } - - public static void gotoLauncher(Context context) { - Intent i = new Intent(Intent.ACTION_MAIN); - i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //android123提示如果是服务里调用,必须加入new task标识 - i.addCategory(Intent.CATEGORY_HOME); - context.startActivity(i); - } - - public static final String Launcher3 = "com.android.launcher3"; - public static final String Launcher3Class = "com.android.launcher3.Launcher"; - - public static void setDefaultDesktop(Context context, String pkg, String className) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - setRoleHolderAsUser(context, pkg); - Log.e(TAG, "setDefaultDesktop: setRoleHolderAsUser"); - } else { - //爱华设置,暂时屏蔽 -// setDefaultLauncher(mContext, pkg, className); - Log.e(TAG, "setDefaultDesktop: setDefaultLauncher"); - } -// String oldDesktop = (String) SPUtils.get(mContext, "default_launcher", ""); -// if (Objects.equals(oldDesktop, pkg)) { -// Log.e(TAG, "setDefaultDesktop: " + "数据一致"); -// return; -// } - Intent intent = new Intent("setDefaultLauncher"); - intent.putExtra("package", pkg); - intent.putExtra("className", className); -// if (JGYUtils.getInstance().checkAppPlatform() == MTKPlatform) { - Log.e(TAG, "setDefaultDesktop: MTK"); - //爱华定制 - intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.AoleReceiver")); - // TODO: 2022/7/6 有问题 - setDefaultLauncher(context, "com.android.transfer", "com.android.transfer.MainActivity"); - SystemProperties.set("persist.sys.launcher.pkgname", pkg); - SystemProperties.set("persist.sys.launcher.classname", className); -// } - intent.setPackage("com.android.settings"); - context.sendBroadcast(intent); -// ApkUtils.openPackage(mContext, pkg); - Log.e(TAG, "setDefaultDesktop: " + pkg + ":" + className); - Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.pkgname = " + SystemProperties.get("persist.sys.launcher.pkgname")); - Log.e(TAG, "setDefaultDesktop: " + "persist.sys.launcher.classname = " + SystemProperties.get("persist.sys.launcher.classname")); - } - - public static void setDefaultLauncher(Context context, String defPackageName, String defClassName) { - try { - if (!TextUtils.isEmpty(defPackageName) && !TextUtils.isEmpty(defClassName)) { - IntentFilter filter = new IntentFilter(); - filter.addAction("android.intent.action.MAIN"); - filter.addCategory("android.intent.category.HOME"); - filter.addCategory("android.intent.category.DEFAULT"); - Intent intent = new Intent(Intent.ACTION_MAIN); - intent.addCategory(Intent.CATEGORY_HOME); - // 返回给定条件的所有ResolveInfo对象(本质上是Activity) - List list = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - int bestMatch = 0; - final int size = list.size(); - ComponentName[] set = new ComponentName[size]; - for (int i = 0; i < size; i++) { - ResolveInfo ri = list.get(i); - set[i] = new ComponentName(ri.activityInfo.packageName, ri.activityInfo.name); - if (ri.match > bestMatch) { - bestMatch = ri.match; - } - } - ComponentName preActivity = new ComponentName(defPackageName, defClassName); - context.getPackageManager().addPreferredActivity(filter, bestMatch, set, preActivity); - } - } catch (java.lang.SecurityException e) { - e.printStackTrace(); - Log.e(TAG, "setDefaultLauncher: " + e.getMessage()); - } - } - - - public static void setRoleHolderAsUser(Context context, String packageName) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - String roleName = "android.app.role.HOME"; - boolean add = true; - int flags = 0; - UserHandle user = android.os.Process.myUserHandle(); - Log.i("settingssssssstemf", (add ? "Adding" : "Removing") + " package as role holder, role: " - + roleName + ", package: " + packageName); -// if (JGYUtils.getInstance().checkAppPlatform() != JGYUtils.MTKPlatform) { - RoleManager roleManager = context.getSystemService(RoleManager.class); - Executor executor = context.getMainExecutor(); - Consumer callback = successful -> { - if (successful) { - Log.d("settingssssssstemf", "Package " + (add ? "added" : "removed") - + " as role holder, role: " + roleName + ", package: " + packageName); - } else { - Log.d("settingssssssstemf", "Failed to " + (add ? "add" : "remove") - + " package as role holder, role: " + roleName + ", package: " - + packageName); - } - }; - roleManager.addRoleHolderAsUser(roleName, packageName, flags, user, executor, callback); - Log.i("settingssssssstemf", "addRoleHolderAsUser done"); -// } - } - } - - public static boolean isDefaultHome(Context context) { - Intent intent = new Intent(Intent.ACTION_MAIN);//Intent.ACTION_VIEW - intent.addCategory("android.intent.category.HOME"); - intent.addCategory("android.intent.category.DEFAULT"); - PackageManager pm = context.getPackageManager(); - ResolveInfo info = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY); - boolean isDefault = context.getPackageName().equals(info.activityInfo.packageName); - return isDefault; - } -} diff --git a/app/src/main/java/com/uiui/zyos/utils/SchemeUtils.java b/app/src/main/java/com/uiui/zyos/utils/SchemeUtils.java deleted file mode 100644 index 9332965..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/SchemeUtils.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.uiui.zyos.utils; - -import android.app.Activity; -import android.content.Intent; -import android.net.Uri; -import android.text.TextUtils; -import android.util.Log; - -public class SchemeUtils { - private static String TAG = SchemeUtils.class.getSimpleName(); - - public static final String SCHEME_TONGUE = "uiuihealth://tongue"; - public static final String SCHEME_FACE = "uiuihealth://face"; - public static final String SCHEME_HAND = "uiuihealth://hand"; - - public static void openScheme(Activity context, String uri) { - if (TextUtils.isEmpty(uri)) { - return; - } - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); - try { - context.startActivity(intent); - } catch (Exception e) { - Log.e(TAG, "openScheme: " + e.getMessage()); - } - } - - - -} diff --git a/app/src/main/java/com/uiui/zyos/utils/WakeUpUtils.java b/app/src/main/java/com/uiui/zyos/utils/WakeUpUtils.java deleted file mode 100644 index 3d349b4..0000000 --- a/app/src/main/java/com/uiui/zyos/utils/WakeUpUtils.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.uiui.zyos.utils; - -import android.annotation.SuppressLint; -import android.app.Activity; -import android.app.KeyguardManager; -import android.content.Context; -import android.os.Build; -import android.os.PowerManager; -import android.util.Log; -import android.view.Window; -import android.view.WindowManager; - -import androidx.annotation.RequiresApi; - -public class WakeUpUtils { - - /** - * 唤醒手机屏幕并解锁 - */ - public static void wakeUpAndUnlock(Activity activity) { - // 获取电源管理器对象 - PowerManager pm = (PowerManager) activity.getApplicationContext() - .getSystemService(Context.POWER_SERVICE); - boolean screenOn = pm.isScreenOn(); - Log.d("WakeScreen0", "screenOn: " + screenOn); - if (!screenOn) { - // 获取PowerManager.WakeLock对象,后面的参数|表示同时传入两个值,最后的是LogCat里用的Tag - @SuppressLint("InvalidWakeLockTag") PowerManager.WakeLock wl = pm.newWakeLock( - PowerManager.ACQUIRE_CAUSES_WAKEUP | - PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "bright"); - wl.acquire(10000); // 点亮屏幕 - wl.release(); // 释放 - } - // 屏幕解锁 - KeyguardManager keyguardManager = (KeyguardManager) activity.getApplicationContext() - .getSystemService(Context.KEYGUARD_SERVICE); - KeyguardManager.KeyguardLock keyguardLock = keyguardManager.newKeyguardLock("unLock"); - // 屏幕锁定 -// keyguardLock.reenableKeyguard(); - keyguardLock.disableKeyguard(); // 解锁 - unLockScreen(activity); - } - - private static void unLockScreen(Activity activity) { - final Window win = activity.getWindow(); - win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED - | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD); - - win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON - | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON - | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON); - } - - /** - * 唤醒手机屏幕并解锁 - */ - @RequiresApi(api = Build.VERSION_CODES.O) - public static void wakeUpAndUnlockScreen(Activity activity) { - - Window win = activity.getWindow(); - win.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD - | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED - | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); - - PowerManager pm = (PowerManager) activity.getSystemService(Context.POWER_SERVICE); - @SuppressLint("InvalidWakeLockTag") - PowerManager.WakeLock wakelock = pm.newWakeLock( - PowerManager.FULL_WAKE_LOCK - | PowerManager.ACQUIRE_CAUSES_WAKEUP, "xx"); - wakelock.acquire(); - wakelock.release(); - - KeyguardManager keyguardManager = (KeyguardManager) activity.getApplicationContext() - .getSystemService(Context.KEYGUARD_SERVICE); - - if (activity == null) return; - keyguardManager.requestDismissKeyguard(activity, new KeyguardManager.KeyguardDismissCallback() { - @Override - public void onDismissError() { - super.onDismissError(); - Log.d("xxx-->", "1 onDismissError"); - } - - @Override - public void onDismissSucceeded() { - super.onDismissSucceeded(); - Log.d("xxx-->", "1 onDismissSucceeded"); - } - - @Override - public void onDismissCancelled() { - super.onDismissCancelled(); - Log.d("xxx-->", "1 onDismissCancelled"); - } - }); - - if (activity == null) return; - keyguardManager.requestDismissKeyguard(activity, new KeyguardManager.KeyguardDismissCallback() { - @Override - public void onDismissError() { - super.onDismissError(); - Log.d("xxx-->", "2 onDismissError"); - } - - @Override - public void onDismissSucceeded() { - super.onDismissSucceeded(); - Log.d("xxx-->", "2 onDismissSucceeded"); - } - - @Override - public void onDismissCancelled() { - super.onDismissCancelled(); - Log.d("xxx-->", "2 onDismissCancelled"); - } - }); - - } -} diff --git a/app/src/main/res/drawable-hdpi/actions_about.png b/app/src/main/res/drawable-hdpi/actions_about.png deleted file mode 100644 index bf8fb68..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_about.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_account.png b/app/src/main/res/drawable-hdpi/actions_account.png deleted file mode 100644 index 83f3f49..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_account.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_booktag.png b/app/src/main/res/drawable-hdpi/actions_booktag.png deleted file mode 100644 index 538c60d..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_booktag.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_cent.png b/app/src/main/res/drawable-hdpi/actions_cent.png deleted file mode 100644 index 02b6df9..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_cent.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_comment.png b/app/src/main/res/drawable-hdpi/actions_comment.png deleted file mode 100644 index 22246f2..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_comment.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_feedback.png b/app/src/main/res/drawable-hdpi/actions_feedback.png deleted file mode 100644 index f47cfa1..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_feedback.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_order.png b/app/src/main/res/drawable-hdpi/actions_order.png deleted file mode 100644 index 065ec3d..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_order.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/actions_weibo.png b/app/src/main/res/drawable-hdpi/actions_weibo.png deleted file mode 100644 index 402d9b7..0000000 Binary files a/app/src/main/res/drawable-hdpi/actions_weibo.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/back.png b/app/src/main/res/drawable-hdpi/back.png deleted file mode 100644 index e57a14b..0000000 Binary files a/app/src/main/res/drawable-hdpi/back.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/back_black.png b/app/src/main/res/drawable-hdpi/back_black.png deleted file mode 100644 index 02c754e..0000000 Binary files a/app/src/main/res/drawable-hdpi/back_black.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/back_white.png b/app/src/main/res/drawable-hdpi/back_white.png deleted file mode 100644 index 28e130e..0000000 Binary files a/app/src/main/res/drawable-hdpi/back_white.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/battery1.png b/app/src/main/res/drawable-hdpi/battery1.png deleted file mode 100644 index 8959a34..0000000 Binary files a/app/src/main/res/drawable-hdpi/battery1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/bluetooth1.png b/app/src/main/res/drawable-hdpi/bluetooth1.png deleted file mode 100644 index 8212fdd..0000000 Binary files a/app/src/main/res/drawable-hdpi/bluetooth1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/brightness1.png b/app/src/main/res/drawable-hdpi/brightness1.png deleted file mode 100644 index 6997b5f..0000000 Binary files a/app/src/main/res/drawable-hdpi/brightness1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/charging_icon.png b/app/src/main/res/drawable-hdpi/charging_icon.png deleted file mode 100644 index 18533e7..0000000 Binary files a/app/src/main/res/drawable-hdpi/charging_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/close.png b/app/src/main/res/drawable-hdpi/close.png deleted file mode 100644 index 37f2f88..0000000 Binary files a/app/src/main/res/drawable-hdpi/close.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_appstore.png b/app/src/main/res/drawable-hdpi/com_android_appstore.png deleted file mode 100644 index 9b06c7c..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_appstore.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_browser.png b/app/src/main/res/drawable-hdpi/com_android_browser.png deleted file mode 100644 index c569613..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_browser.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_calculator2.png b/app/src/main/res/drawable-hdpi/com_android_calculator2.png deleted file mode 100644 index 31402e7..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_calculator2.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_calendar.png b/app/src/main/res/drawable-hdpi/com_android_calendar.png deleted file mode 100644 index 0065e28..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_calendar.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_camera.png b/app/src/main/res/drawable-hdpi/com_android_camera.png deleted file mode 100644 index bbeb62c..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_camera.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_clean.png b/app/src/main/res/drawable-hdpi/com_android_clean.png deleted file mode 100644 index be7eae1..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_clean.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_contacts.png b/app/src/main/res/drawable-hdpi/com_android_contacts.png deleted file mode 100644 index b204ea0..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_contacts.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_deskclock.png b/app/src/main/res/drawable-hdpi/com_android_deskclock.png deleted file mode 100644 index 81bf96f..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_deskclock.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_dialer.png b/app/src/main/res/drawable-hdpi/com_android_dialer.png deleted file mode 100644 index 5bf5306..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_dialer.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_email.png b/app/src/main/res/drawable-hdpi/com_android_email.png deleted file mode 100644 index 2eb7a70..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_email.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_gallery3d_app.png b/app/src/main/res/drawable-hdpi/com_android_gallery3d_app.png deleted file mode 100644 index a5177c3..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_gallery3d_app.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_mms_ui.png b/app/src/main/res/drawable-hdpi/com_android_mms_ui.png deleted file mode 100644 index 1ac19f2..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_mms_ui.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_music.png b/app/src/main/res/drawable-hdpi/com_android_music.png deleted file mode 100644 index d0b55a9..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_music.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_providers_downloads_ui.png b/app/src/main/res/drawable-hdpi/com_android_providers_downloads_ui.png deleted file mode 100644 index 55cd1e9..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_providers_downloads_ui.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_quicksearchbox.png b/app/src/main/res/drawable-hdpi/com_android_quicksearchbox.png deleted file mode 100644 index fd8b051..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_quicksearchbox.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_settings.png b/app/src/main/res/drawable-hdpi/com_android_settings.png deleted file mode 100644 index ad4e3a7..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_settings.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_soundrecorder.png b/app/src/main/res/drawable-hdpi/com_android_soundrecorder.png deleted file mode 100644 index 538075f..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_soundrecorder.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_stk_stkmain.png b/app/src/main/res/drawable-hdpi/com_android_stk_stkmain.png deleted file mode 100644 index 1af7e9e..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_stk_stkmain.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_android_vdieo.png b/app/src/main/res/drawable-hdpi/com_android_vdieo.png deleted file mode 100644 index a031a22..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_android_vdieo.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_mediatek_filemanager.png b/app/src/main/res/drawable-hdpi/com_mediatek_filemanager.png deleted file mode 100644 index 2c5128a..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_mediatek_filemanager.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_mediatek_fmradio.png b/app/src/main/res/drawable-hdpi/com_mediatek_fmradio.png deleted file mode 100644 index f62afdf..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_mediatek_fmradio.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/com_uiui_sn.png b/app/src/main/res/drawable-hdpi/com_uiui_sn.png deleted file mode 100644 index d4d1d10..0000000 Binary files a/app/src/main/res/drawable-hdpi/com_uiui_sn.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/control_background.png b/app/src/main/res/drawable-hdpi/control_background.png deleted file mode 100644 index 0fce687..0000000 Binary files a/app/src/main/res/drawable-hdpi/control_background.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/default_head.png b/app/src/main/res/drawable-hdpi/default_head.png deleted file mode 100644 index 4dc3c83..0000000 Binary files a/app/src/main/res/drawable-hdpi/default_head.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/delete.png b/app/src/main/res/drawable-hdpi/delete.png deleted file mode 100644 index 521bf24..0000000 Binary files a/app/src/main/res/drawable-hdpi/delete.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/flashlight1.png b/app/src/main/res/drawable-hdpi/flashlight1.png deleted file mode 100644 index c419b65..0000000 Binary files a/app/src/main/res/drawable-hdpi/flashlight1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/font_size.png b/app/src/main/res/drawable-hdpi/font_size.png deleted file mode 100644 index 84e2d3f..0000000 Binary files a/app/src/main/res/drawable-hdpi/font_size.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/gallery_icon.png b/app/src/main/res/drawable-hdpi/gallery_icon.png deleted file mode 100644 index f509ece..0000000 Binary files a/app/src/main/res/drawable-hdpi/gallery_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he100.png b/app/src/main/res/drawable-hdpi/he100.png deleted file mode 100644 index 6669841..0000000 Binary files a/app/src/main/res/drawable-hdpi/he100.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he101.png b/app/src/main/res/drawable-hdpi/he101.png deleted file mode 100644 index 2f74dcf..0000000 Binary files a/app/src/main/res/drawable-hdpi/he101.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he102.png b/app/src/main/res/drawable-hdpi/he102.png deleted file mode 100644 index 784b078..0000000 Binary files a/app/src/main/res/drawable-hdpi/he102.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he103.png b/app/src/main/res/drawable-hdpi/he103.png deleted file mode 100644 index 8767acb..0000000 Binary files a/app/src/main/res/drawable-hdpi/he103.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he104.png b/app/src/main/res/drawable-hdpi/he104.png deleted file mode 100644 index 6420624..0000000 Binary files a/app/src/main/res/drawable-hdpi/he104.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he150.png b/app/src/main/res/drawable-hdpi/he150.png deleted file mode 100644 index df55ec5..0000000 Binary files a/app/src/main/res/drawable-hdpi/he150.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he153.png b/app/src/main/res/drawable-hdpi/he153.png deleted file mode 100644 index f018af0..0000000 Binary files a/app/src/main/res/drawable-hdpi/he153.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he154.png b/app/src/main/res/drawable-hdpi/he154.png deleted file mode 100644 index 22f42c0..0000000 Binary files a/app/src/main/res/drawable-hdpi/he154.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he300.png b/app/src/main/res/drawable-hdpi/he300.png deleted file mode 100644 index 1de84ba..0000000 Binary files a/app/src/main/res/drawable-hdpi/he300.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he301.png b/app/src/main/res/drawable-hdpi/he301.png deleted file mode 100644 index 0fc3b9d..0000000 Binary files a/app/src/main/res/drawable-hdpi/he301.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he302.png b/app/src/main/res/drawable-hdpi/he302.png deleted file mode 100644 index 61c4406..0000000 Binary files a/app/src/main/res/drawable-hdpi/he302.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he303.png b/app/src/main/res/drawable-hdpi/he303.png deleted file mode 100644 index 6a8b3c4..0000000 Binary files a/app/src/main/res/drawable-hdpi/he303.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he304.png b/app/src/main/res/drawable-hdpi/he304.png deleted file mode 100644 index 19a2556..0000000 Binary files a/app/src/main/res/drawable-hdpi/he304.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he305.png b/app/src/main/res/drawable-hdpi/he305.png deleted file mode 100644 index 1105af0..0000000 Binary files a/app/src/main/res/drawable-hdpi/he305.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he306.png b/app/src/main/res/drawable-hdpi/he306.png deleted file mode 100644 index b307070..0000000 Binary files a/app/src/main/res/drawable-hdpi/he306.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he307.png b/app/src/main/res/drawable-hdpi/he307.png deleted file mode 100644 index 810a23a..0000000 Binary files a/app/src/main/res/drawable-hdpi/he307.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he308.png b/app/src/main/res/drawable-hdpi/he308.png deleted file mode 100644 index 9600919..0000000 Binary files a/app/src/main/res/drawable-hdpi/he308.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he309.png b/app/src/main/res/drawable-hdpi/he309.png deleted file mode 100644 index 9c805d8..0000000 Binary files a/app/src/main/res/drawable-hdpi/he309.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he310.png b/app/src/main/res/drawable-hdpi/he310.png deleted file mode 100644 index 9608b6e..0000000 Binary files a/app/src/main/res/drawable-hdpi/he310.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he311.png b/app/src/main/res/drawable-hdpi/he311.png deleted file mode 100644 index 59c74ed..0000000 Binary files a/app/src/main/res/drawable-hdpi/he311.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he312.png b/app/src/main/res/drawable-hdpi/he312.png deleted file mode 100644 index 1daa1da..0000000 Binary files a/app/src/main/res/drawable-hdpi/he312.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he313.png b/app/src/main/res/drawable-hdpi/he313.png deleted file mode 100644 index 11ca685..0000000 Binary files a/app/src/main/res/drawable-hdpi/he313.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he314.png b/app/src/main/res/drawable-hdpi/he314.png deleted file mode 100644 index 3b6ac91..0000000 Binary files a/app/src/main/res/drawable-hdpi/he314.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he315.png b/app/src/main/res/drawable-hdpi/he315.png deleted file mode 100644 index 8f06fae..0000000 Binary files a/app/src/main/res/drawable-hdpi/he315.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he316.png b/app/src/main/res/drawable-hdpi/he316.png deleted file mode 100644 index b3395ac..0000000 Binary files a/app/src/main/res/drawable-hdpi/he316.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he317.png b/app/src/main/res/drawable-hdpi/he317.png deleted file mode 100644 index 8441d41..0000000 Binary files a/app/src/main/res/drawable-hdpi/he317.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he318.png b/app/src/main/res/drawable-hdpi/he318.png deleted file mode 100644 index af60e09..0000000 Binary files a/app/src/main/res/drawable-hdpi/he318.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he350.png b/app/src/main/res/drawable-hdpi/he350.png deleted file mode 100644 index 3976006..0000000 Binary files a/app/src/main/res/drawable-hdpi/he350.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he351.png b/app/src/main/res/drawable-hdpi/he351.png deleted file mode 100644 index b436ea4..0000000 Binary files a/app/src/main/res/drawable-hdpi/he351.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he399.png b/app/src/main/res/drawable-hdpi/he399.png deleted file mode 100644 index 44a094c..0000000 Binary files a/app/src/main/res/drawable-hdpi/he399.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he400.png b/app/src/main/res/drawable-hdpi/he400.png deleted file mode 100644 index e512d55..0000000 Binary files a/app/src/main/res/drawable-hdpi/he400.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he401.png b/app/src/main/res/drawable-hdpi/he401.png deleted file mode 100644 index 4765e28..0000000 Binary files a/app/src/main/res/drawable-hdpi/he401.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he402.png b/app/src/main/res/drawable-hdpi/he402.png deleted file mode 100644 index 4fab297..0000000 Binary files a/app/src/main/res/drawable-hdpi/he402.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he403.png b/app/src/main/res/drawable-hdpi/he403.png deleted file mode 100644 index 77f12a6..0000000 Binary files a/app/src/main/res/drawable-hdpi/he403.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he404.png b/app/src/main/res/drawable-hdpi/he404.png deleted file mode 100644 index a70a3d0..0000000 Binary files a/app/src/main/res/drawable-hdpi/he404.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he405.png b/app/src/main/res/drawable-hdpi/he405.png deleted file mode 100644 index 697c726..0000000 Binary files a/app/src/main/res/drawable-hdpi/he405.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he406.png b/app/src/main/res/drawable-hdpi/he406.png deleted file mode 100644 index 38657ca..0000000 Binary files a/app/src/main/res/drawable-hdpi/he406.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he407.png b/app/src/main/res/drawable-hdpi/he407.png deleted file mode 100644 index 12647d2..0000000 Binary files a/app/src/main/res/drawable-hdpi/he407.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he408.png b/app/src/main/res/drawable-hdpi/he408.png deleted file mode 100644 index 5e11377..0000000 Binary files a/app/src/main/res/drawable-hdpi/he408.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he409.png b/app/src/main/res/drawable-hdpi/he409.png deleted file mode 100644 index 5794537..0000000 Binary files a/app/src/main/res/drawable-hdpi/he409.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he410.png b/app/src/main/res/drawable-hdpi/he410.png deleted file mode 100644 index b2077a1..0000000 Binary files a/app/src/main/res/drawable-hdpi/he410.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he456.png b/app/src/main/res/drawable-hdpi/he456.png deleted file mode 100644 index 1664034..0000000 Binary files a/app/src/main/res/drawable-hdpi/he456.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he457.png b/app/src/main/res/drawable-hdpi/he457.png deleted file mode 100644 index 1f56270..0000000 Binary files a/app/src/main/res/drawable-hdpi/he457.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he499.png b/app/src/main/res/drawable-hdpi/he499.png deleted file mode 100644 index bc2fbd4..0000000 Binary files a/app/src/main/res/drawable-hdpi/he499.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he500.png b/app/src/main/res/drawable-hdpi/he500.png deleted file mode 100644 index d2ec7d6..0000000 Binary files a/app/src/main/res/drawable-hdpi/he500.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he501.png b/app/src/main/res/drawable-hdpi/he501.png deleted file mode 100644 index ef3bc16..0000000 Binary files a/app/src/main/res/drawable-hdpi/he501.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he502.png b/app/src/main/res/drawable-hdpi/he502.png deleted file mode 100644 index e7816da..0000000 Binary files a/app/src/main/res/drawable-hdpi/he502.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he503.png b/app/src/main/res/drawable-hdpi/he503.png deleted file mode 100644 index 0e5b5d1..0000000 Binary files a/app/src/main/res/drawable-hdpi/he503.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he504.png b/app/src/main/res/drawable-hdpi/he504.png deleted file mode 100644 index 185b37d..0000000 Binary files a/app/src/main/res/drawable-hdpi/he504.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he507.png b/app/src/main/res/drawable-hdpi/he507.png deleted file mode 100644 index 4a6403d..0000000 Binary files a/app/src/main/res/drawable-hdpi/he507.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he508.png b/app/src/main/res/drawable-hdpi/he508.png deleted file mode 100644 index a3a333f..0000000 Binary files a/app/src/main/res/drawable-hdpi/he508.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he509.png b/app/src/main/res/drawable-hdpi/he509.png deleted file mode 100644 index 5900d5c..0000000 Binary files a/app/src/main/res/drawable-hdpi/he509.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he510.png b/app/src/main/res/drawable-hdpi/he510.png deleted file mode 100644 index fdf6422..0000000 Binary files a/app/src/main/res/drawable-hdpi/he510.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he511.png b/app/src/main/res/drawable-hdpi/he511.png deleted file mode 100644 index 40cfd0e..0000000 Binary files a/app/src/main/res/drawable-hdpi/he511.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he512.png b/app/src/main/res/drawable-hdpi/he512.png deleted file mode 100644 index 22ab63a..0000000 Binary files a/app/src/main/res/drawable-hdpi/he512.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he513.png b/app/src/main/res/drawable-hdpi/he513.png deleted file mode 100644 index 6e8c4e3..0000000 Binary files a/app/src/main/res/drawable-hdpi/he513.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he514.png b/app/src/main/res/drawable-hdpi/he514.png deleted file mode 100644 index 5892ad0..0000000 Binary files a/app/src/main/res/drawable-hdpi/he514.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he515.png b/app/src/main/res/drawable-hdpi/he515.png deleted file mode 100644 index 518137a..0000000 Binary files a/app/src/main/res/drawable-hdpi/he515.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he900.png b/app/src/main/res/drawable-hdpi/he900.png deleted file mode 100644 index 020b8e3..0000000 Binary files a/app/src/main/res/drawable-hdpi/he900.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he901.png b/app/src/main/res/drawable-hdpi/he901.png deleted file mode 100644 index df59561..0000000 Binary files a/app/src/main/res/drawable-hdpi/he901.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/he999.png b/app/src/main/res/drawable-hdpi/he999.png deleted file mode 100644 index bb0c9f9..0000000 Binary files a/app/src/main/res/drawable-hdpi/he999.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_activation_icon.png b/app/src/main/res/drawable-hdpi/home_activation_icon.png deleted file mode 100644 index 62b6183..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_activation_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_appstore_icon.png b/app/src/main/res/drawable-hdpi/home_appstore_icon.png deleted file mode 100644 index 69cc9c8..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_appstore_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_clean_icon.png b/app/src/main/res/drawable-hdpi/home_clean_icon.png deleted file mode 100644 index 8d6e541..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_clean_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_clinical_detection.png b/app/src/main/res/drawable-hdpi/home_clinical_detection.png deleted file mode 100644 index 3e60ede..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_clinical_detection.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_clinical_face.png b/app/src/main/res/drawable-hdpi/home_clinical_face.png deleted file mode 100644 index b11093c..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_clinical_face.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_clinical_hand.png b/app/src/main/res/drawable-hdpi/home_clinical_hand.png deleted file mode 100644 index 892581b..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_clinical_hand.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_clinical_tongue.png b/app/src/main/res/drawable-hdpi/home_clinical_tongue.png deleted file mode 100644 index aa0c298..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_clinical_tongue.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_contact_icon.png b/app/src/main/res/drawable-hdpi/home_contact_icon.png deleted file mode 100644 index 784bc19..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_contact_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_health_code.png b/app/src/main/res/drawable-hdpi/home_health_code.png deleted file mode 100644 index 4f47639..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_health_code.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_quick_app.png b/app/src/main/res/drawable-hdpi/home_quick_app.png deleted file mode 100644 index c8e5439..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_quick_app.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_reminder_icon.png b/app/src/main/res/drawable-hdpi/home_reminder_icon.png deleted file mode 100644 index d7ef6f0..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_reminder_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/home_sos_icon.png b/app/src/main/res/drawable-hdpi/home_sos_icon.png deleted file mode 100644 index 4d0f991..0000000 Binary files a/app/src/main/res/drawable-hdpi/home_sos_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_uninstall.png b/app/src/main/res/drawable-hdpi/ic_uninstall.png deleted file mode 100644 index e2d34df..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_uninstall.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/icon_dialer.png b/app/src/main/res/drawable-hdpi/icon_dialer.png deleted file mode 100644 index c657b8a..0000000 Binary files a/app/src/main/res/drawable-hdpi/icon_dialer.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/icon_location.png b/app/src/main/res/drawable-hdpi/icon_location.png deleted file mode 100644 index c2ec430..0000000 Binary files a/app/src/main/res/drawable-hdpi/icon_location.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/icon_selected.png b/app/src/main/res/drawable-hdpi/icon_selected.png deleted file mode 100644 index d9560f2..0000000 Binary files a/app/src/main/res/drawable-hdpi/icon_selected.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/icon_unselected.png b/app/src/main/res/drawable-hdpi/icon_unselected.png deleted file mode 100644 index d21c906..0000000 Binary files a/app/src/main/res/drawable-hdpi/icon_unselected.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/location.png b/app/src/main/res/drawable-hdpi/location.png deleted file mode 100644 index 293f0c9..0000000 Binary files a/app/src/main/res/drawable-hdpi/location.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/more.png b/app/src/main/res/drawable-hdpi/more.png deleted file mode 100644 index b5fb61b..0000000 Binary files a/app/src/main/res/drawable-hdpi/more.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/nodata.png b/app/src/main/res/drawable-hdpi/nodata.png deleted file mode 100644 index a665cc3..0000000 Binary files a/app/src/main/res/drawable-hdpi/nodata.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/note_nodata.png b/app/src/main/res/drawable-hdpi/note_nodata.png deleted file mode 100644 index f9a5ea1..0000000 Binary files a/app/src/main/res/drawable-hdpi/note_nodata.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/position.png b/app/src/main/res/drawable-hdpi/position.png deleted file mode 100644 index 7a9e54e..0000000 Binary files a/app/src/main/res/drawable-hdpi/position.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/scan_qrcode.png b/app/src/main/res/drawable-hdpi/scan_qrcode.png deleted file mode 100644 index 1ee8ab0..0000000 Binary files a/app/src/main/res/drawable-hdpi/scan_qrcode.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/shafa.png b/app/src/main/res/drawable-hdpi/shafa.png deleted file mode 100644 index 81f4eb0..0000000 Binary files a/app/src/main/res/drawable-hdpi/shafa.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/sound1.png b/app/src/main/res/drawable-hdpi/sound1.png deleted file mode 100644 index 0d95b28..0000000 Binary files a/app/src/main/res/drawable-hdpi/sound1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/systemapp_icon.png b/app/src/main/res/drawable-hdpi/systemapp_icon.png deleted file mode 100644 index 4e403d5..0000000 Binary files a/app/src/main/res/drawable-hdpi/systemapp_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/time1.png b/app/src/main/res/drawable-hdpi/time1.png deleted file mode 100644 index 3b9ffc0..0000000 Binary files a/app/src/main/res/drawable-hdpi/time1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/voice.png b/app/src/main/res/drawable-hdpi/voice.png deleted file mode 100644 index 7ee7cbf..0000000 Binary files a/app/src/main/res/drawable-hdpi/voice.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/wallpaper.png b/app/src/main/res/drawable-hdpi/wallpaper.png deleted file mode 100644 index 69167b4..0000000 Binary files a/app/src/main/res/drawable-hdpi/wallpaper.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/wifi1.png b/app/src/main/res/drawable-hdpi/wifi1.png deleted file mode 100644 index 8fefacb..0000000 Binary files a/app/src/main/res/drawable-hdpi/wifi1.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/wifi_icon.png b/app/src/main/res/drawable-hdpi/wifi_icon.png deleted file mode 100644 index cc62e04..0000000 Binary files a/app/src/main/res/drawable-hdpi/wifi_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/zan.png b/app/src/main/res/drawable-hdpi/zan.png deleted file mode 100644 index e355491..0000000 Binary files a/app/src/main/res/drawable-hdpi/zan.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/biological_fine_volume.png b/app/src/main/res/drawable-xhdpi/biological_fine_volume.png new file mode 100644 index 0000000..9c2145e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/biological_fine_volume.png differ diff --git a/app/src/main/res/drawable-xhdpi/biology_box.png b/app/src/main/res/drawable-xhdpi/biology_box.png new file mode 100644 index 0000000..23f2bbd Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/biology_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/biology_laboratory.png b/app/src/main/res/drawable-xhdpi/biology_laboratory.png new file mode 100644 index 0000000..75c5579 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/biology_laboratory.png differ diff --git a/app/src/main/res/drawable-xhdpi/biology_synchronous_explanation.png b/app/src/main/res/drawable-xhdpi/biology_synchronous_explanation.png new file mode 100644 index 0000000..a1d4580 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/biology_synchronous_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/biology_unit_testing.png b/app/src/main/res/drawable-xhdpi/biology_unit_testing.png new file mode 100644 index 0000000..d17af41 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/biology_unit_testing.png differ diff --git a/app/src/main/res/drawable-xhdpi/chemical_box.png b/app/src/main/res/drawable-xhdpi/chemical_box.png new file mode 100644 index 0000000..904a9cb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chemical_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/chemical_fine_volume.png b/app/src/main/res/drawable-xhdpi/chemical_fine_volume.png new file mode 100644 index 0000000..26ab054 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chemical_fine_volume.png differ diff --git a/app/src/main/res/drawable-xhdpi/chemical_lab.png b/app/src/main/res/drawable-xhdpi/chemical_lab.png new file mode 100644 index 0000000..5d8dddb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chemical_lab.png differ diff --git a/app/src/main/res/drawable-xhdpi/chemical_synchronous_explanation.png b/app/src/main/res/drawable-xhdpi/chemical_synchronous_explanation.png new file mode 100644 index 0000000..aff7059 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chemical_synchronous_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_box.png b/app/src/main/res/drawable-xhdpi/chinese_box.png new file mode 100644 index 0000000..dc3af37 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_composition_correction.png b/app/src/main/res/drawable-xhdpi/chinese_composition_correction.png new file mode 100644 index 0000000..3069dd4 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_composition_correction.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_excellent_volume.png b/app/src/main/res/drawable-xhdpi/chinese_excellent_volume.png new file mode 100644 index 0000000..72246a9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_excellent_volume.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_poetry_world.png b/app/src/main/res/drawable-xhdpi/chinese_poetry_world.png new file mode 100644 index 0000000..400b905 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_poetry_world.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_synchronous_explanation.png b/app/src/main/res/drawable-xhdpi/chinese_synchronous_explanation.png new file mode 100644 index 0000000..79b296c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_synchronous_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/chinese_unit_test.png b/app/src/main/res/drawable-xhdpi/chinese_unit_test.png new file mode 100644 index 0000000..c553e01 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/chinese_unit_test.png differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_appstore2.png b/app/src/main/res/drawable-xhdpi/com_android_appstore2.png deleted file mode 100644 index 78caed9..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_appstore2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_aweme2.png b/app/src/main/res/drawable-xhdpi/com_android_aweme2.png deleted file mode 100644 index 0b82a44..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_aweme2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_browser2.png b/app/src/main/res/drawable-xhdpi/com_android_browser2.png deleted file mode 100644 index 323d3ef..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_browser2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_camera2.png b/app/src/main/res/drawable-xhdpi/com_android_camera2.png deleted file mode 100644 index 787e8a4..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_camera2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_dialer2.png b/app/src/main/res/drawable-xhdpi/com_android_dialer2.png deleted file mode 100644 index d80b7cd..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_dialer2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_gallery3d_app2.png b/app/src/main/res/drawable-xhdpi/com_android_gallery3d_app2.png deleted file mode 100644 index e56a505..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_gallery3d_app2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_mms_ui2.png b/app/src/main/res/drawable-xhdpi/com_android_mms_ui2.png deleted file mode 100644 index c62fec1..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_mms_ui2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_news2.png b/app/src/main/res/drawable-xhdpi/com_android_news2.png deleted file mode 100644 index bef60f1..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_news2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_android_settings2.png b/app/src/main/res/drawable-xhdpi/com_android_settings2.png deleted file mode 100644 index 10cb0b8..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_android_settings2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_tencent_mm2.png b/app/src/main/res/drawable-xhdpi/com_tencent_mm2.png deleted file mode 100644 index d67b701..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_tencent_mm2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_uiui_sn2.png b/app/src/main/res/drawable-xhdpi/com_uiui_sn2.png deleted file mode 100644 index ac506a9..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_uiui_sn2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/com_uiui_weather2.png b/app/src/main/res/drawable-xhdpi/com_uiui_weather2.png deleted file mode 100644 index c64d302..0000000 Binary files a/app/src/main/res/drawable-xhdpi/com_uiui_weather2.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/english_box.png b/app/src/main/res/drawable-xhdpi/english_box.png new file mode 100644 index 0000000..bacc375 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_composition_correction.png b/app/src/main/res/drawable-xhdpi/english_composition_correction.png new file mode 100644 index 0000000..410132b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_composition_correction.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_explanation.png b/app/src/main/res/drawable-xhdpi/english_explanation.png new file mode 100644 index 0000000..383dd2f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_listen_and_speak_special.png b/app/src/main/res/drawable-xhdpi/english_listen_and_speak_special.png new file mode 100644 index 0000000..4966cfe Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_listen_and_speak_special.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_listen_read.png b/app/src/main/res/drawable-xhdpi/english_listen_read.png new file mode 100644 index 0000000..0f7370f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_listen_read.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_remember_words.png b/app/src/main/res/drawable-xhdpi/english_remember_words.png new file mode 100644 index 0000000..e29e9a5 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_remember_words.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_synchronous_vocabulary.png b/app/src/main/res/drawable-xhdpi/english_synchronous_vocabulary.png new file mode 100644 index 0000000..788a5bb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_synchronous_vocabulary.png differ diff --git a/app/src/main/res/drawable-xhdpi/english_unit_practice.png b/app/src/main/res/drawable-xhdpi/english_unit_practice.png new file mode 100644 index 0000000..780d98d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/english_unit_practice.png differ diff --git a/app/src/main/res/drawable-xhdpi/he100.png b/app/src/main/res/drawable-xhdpi/he100.png deleted file mode 100644 index faf04c8..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he100.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he101.png b/app/src/main/res/drawable-xhdpi/he101.png deleted file mode 100644 index 17841e4..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he101.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he102.png b/app/src/main/res/drawable-xhdpi/he102.png deleted file mode 100644 index 51bc5a8..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he102.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he103.png b/app/src/main/res/drawable-xhdpi/he103.png deleted file mode 100644 index 5fd9957..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he103.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he104.png b/app/src/main/res/drawable-xhdpi/he104.png deleted file mode 100644 index 9628fbd..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he104.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he150.png b/app/src/main/res/drawable-xhdpi/he150.png deleted file mode 100644 index eaee769..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he150.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he153.png b/app/src/main/res/drawable-xhdpi/he153.png deleted file mode 100644 index 346a2c2..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he153.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he154.png b/app/src/main/res/drawable-xhdpi/he154.png deleted file mode 100644 index 358be1a..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he154.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he300.png b/app/src/main/res/drawable-xhdpi/he300.png deleted file mode 100644 index 24ba9bc..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he300.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he301.png b/app/src/main/res/drawable-xhdpi/he301.png deleted file mode 100644 index ad65de8..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he301.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he302.png b/app/src/main/res/drawable-xhdpi/he302.png deleted file mode 100644 index 4a018ee..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he302.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he303.png b/app/src/main/res/drawable-xhdpi/he303.png deleted file mode 100644 index aa8d273..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he303.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he304.png b/app/src/main/res/drawable-xhdpi/he304.png deleted file mode 100644 index 3155a49..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he304.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he305.png b/app/src/main/res/drawable-xhdpi/he305.png deleted file mode 100644 index f76f6e3..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he305.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he306.png b/app/src/main/res/drawable-xhdpi/he306.png deleted file mode 100644 index ffb6804..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he306.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he307.png b/app/src/main/res/drawable-xhdpi/he307.png deleted file mode 100644 index 1e33073..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he307.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he308.png b/app/src/main/res/drawable-xhdpi/he308.png deleted file mode 100644 index 2586187..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he308.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he309.png b/app/src/main/res/drawable-xhdpi/he309.png deleted file mode 100644 index 9beebe3..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he309.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he310.png b/app/src/main/res/drawable-xhdpi/he310.png deleted file mode 100644 index 624b04e..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he310.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he311.png b/app/src/main/res/drawable-xhdpi/he311.png deleted file mode 100644 index 5fcc3fc..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he311.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he312.png b/app/src/main/res/drawable-xhdpi/he312.png deleted file mode 100644 index 0e93ff7..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he312.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he313.png b/app/src/main/res/drawable-xhdpi/he313.png deleted file mode 100644 index ba783d6..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he313.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he314.png b/app/src/main/res/drawable-xhdpi/he314.png deleted file mode 100644 index 9e93846..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he314.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he315.png b/app/src/main/res/drawable-xhdpi/he315.png deleted file mode 100644 index 527e6fe..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he315.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he316.png b/app/src/main/res/drawable-xhdpi/he316.png deleted file mode 100644 index 8309afb..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he316.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he317.png b/app/src/main/res/drawable-xhdpi/he317.png deleted file mode 100644 index 2e9a702..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he317.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he318.png b/app/src/main/res/drawable-xhdpi/he318.png deleted file mode 100644 index b99b851..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he318.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he350.png b/app/src/main/res/drawable-xhdpi/he350.png deleted file mode 100644 index a9a0c52..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he350.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he351.png b/app/src/main/res/drawable-xhdpi/he351.png deleted file mode 100644 index f7bdda3..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he351.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he399.png b/app/src/main/res/drawable-xhdpi/he399.png deleted file mode 100644 index 321233b..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he399.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he400.png b/app/src/main/res/drawable-xhdpi/he400.png deleted file mode 100644 index 532879b..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he400.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he401.png b/app/src/main/res/drawable-xhdpi/he401.png deleted file mode 100644 index 4a92fc7..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he401.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he402.png b/app/src/main/res/drawable-xhdpi/he402.png deleted file mode 100644 index ccc2dab..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he402.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he403.png b/app/src/main/res/drawable-xhdpi/he403.png deleted file mode 100644 index da32ebe..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he403.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he404.png b/app/src/main/res/drawable-xhdpi/he404.png deleted file mode 100644 index 99a3d9d..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he404.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he405.png b/app/src/main/res/drawable-xhdpi/he405.png deleted file mode 100644 index c3ac8d4..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he405.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he406.png b/app/src/main/res/drawable-xhdpi/he406.png deleted file mode 100644 index 01348b1..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he406.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he407.png b/app/src/main/res/drawable-xhdpi/he407.png deleted file mode 100644 index 37cdd78..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he407.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he408.png b/app/src/main/res/drawable-xhdpi/he408.png deleted file mode 100644 index f8d216c..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he408.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he409.png b/app/src/main/res/drawable-xhdpi/he409.png deleted file mode 100644 index e7e729b..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he409.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he410.png b/app/src/main/res/drawable-xhdpi/he410.png deleted file mode 100644 index 3e4dcf2..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he410.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he456.png b/app/src/main/res/drawable-xhdpi/he456.png deleted file mode 100644 index 1b080c7..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he456.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he457.png b/app/src/main/res/drawable-xhdpi/he457.png deleted file mode 100644 index 1b610d2..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he457.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he499.png b/app/src/main/res/drawable-xhdpi/he499.png deleted file mode 100644 index c486a59..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he499.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he500.png b/app/src/main/res/drawable-xhdpi/he500.png deleted file mode 100644 index dcecc31..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he500.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he501.png b/app/src/main/res/drawable-xhdpi/he501.png deleted file mode 100644 index 41fba52..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he501.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he502.png b/app/src/main/res/drawable-xhdpi/he502.png deleted file mode 100644 index 6ffda43..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he502.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he503.png b/app/src/main/res/drawable-xhdpi/he503.png deleted file mode 100644 index f7e2296..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he503.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he504.png b/app/src/main/res/drawable-xhdpi/he504.png deleted file mode 100644 index b26ea7b..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he504.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he507.png b/app/src/main/res/drawable-xhdpi/he507.png deleted file mode 100644 index 43b1e6e..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he507.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he508.png b/app/src/main/res/drawable-xhdpi/he508.png deleted file mode 100644 index f932cd9..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he508.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he509.png b/app/src/main/res/drawable-xhdpi/he509.png deleted file mode 100644 index b1a8adb..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he509.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he510.png b/app/src/main/res/drawable-xhdpi/he510.png deleted file mode 100644 index eecaf5d..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he510.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he511.png b/app/src/main/res/drawable-xhdpi/he511.png deleted file mode 100644 index b0bcd8e..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he511.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he512.png b/app/src/main/res/drawable-xhdpi/he512.png deleted file mode 100644 index 0d98a13..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he512.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he513.png b/app/src/main/res/drawable-xhdpi/he513.png deleted file mode 100644 index e1128ff..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he513.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he514.png b/app/src/main/res/drawable-xhdpi/he514.png deleted file mode 100644 index cb9adbc..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he514.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he515.png b/app/src/main/res/drawable-xhdpi/he515.png deleted file mode 100644 index 2faa917..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he515.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he900.png b/app/src/main/res/drawable-xhdpi/he900.png deleted file mode 100644 index cbdb3e7..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he900.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he901.png b/app/src/main/res/drawable-xhdpi/he901.png deleted file mode 100644 index bc6d105..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he901.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/he999.png b/app/src/main/res/drawable-xhdpi/he999.png deleted file mode 100644 index 4ce8569..0000000 Binary files a/app/src/main/res/drawable-xhdpi/he999.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/icon_dictionary.png b/app/src/main/res/drawable-xhdpi/icon_dictionary.png new file mode 100644 index 0000000..e883e31 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_dictionary.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_error_book.png b/app/src/main/res/drawable-xhdpi/icon_error_book.png new file mode 100644 index 0000000..e0138a8 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_error_book.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_expand.png b/app/src/main/res/drawable-xhdpi/icon_expand.png new file mode 100644 index 0000000..1a6ee43 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_expand.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_glossary.png b/app/src/main/res/drawable-xhdpi/icon_glossary.png new file mode 100644 index 0000000..d83b0a0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_glossary.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_homework.png b/app/src/main/res/drawable-xhdpi/icon_homework.png new file mode 100644 index 0000000..adacb83 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_homework.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_listen.png b/app/src/main/res/drawable-xhdpi/icon_listen.png new file mode 100644 index 0000000..7a0951e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_listen.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_sync_exercises.png b/app/src/main/res/drawable-xhdpi/icon_sync_exercises.png new file mode 100644 index 0000000..63f4b74 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_sync_exercises.png differ diff --git a/app/src/main/res/drawable-xhdpi/icon_textbook_sync.png b/app/src/main/res/drawable-xhdpi/icon_textbook_sync.png new file mode 100644 index 0000000..6d85b98 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/icon_textbook_sync.png differ diff --git a/app/src/main/res/drawable-xhdpi/main_background.png b/app/src/main/res/drawable-xhdpi/main_background.png new file mode 100644 index 0000000..47115ac Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/main_background.png differ diff --git a/app/src/main/res/drawable-xhdpi/math_box.png b/app/src/main/res/drawable-xhdpi/math_box.png new file mode 100644 index 0000000..5da4ece Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/math_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/math_excellent_volume.png b/app/src/main/res/drawable-xhdpi/math_excellent_volume.png new file mode 100644 index 0000000..1028a4e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/math_excellent_volume.png differ diff --git a/app/src/main/res/drawable-xhdpi/math_synchronous_explanation.png b/app/src/main/res/drawable-xhdpi/math_synchronous_explanation.png new file mode 100644 index 0000000..f00916c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/math_synchronous_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/math_unit_test.png b/app/src/main/res/drawable-xhdpi/math_unit_test.png new file mode 100644 index 0000000..5d8d5e7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/math_unit_test.png differ diff --git a/app/src/main/res/drawable-xhdpi/physical_box.png b/app/src/main/res/drawable-xhdpi/physical_box.png new file mode 100644 index 0000000..a62d575 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/physical_box.png differ diff --git a/app/src/main/res/drawable-xhdpi/physical_fine_volume.png b/app/src/main/res/drawable-xhdpi/physical_fine_volume.png new file mode 100644 index 0000000..653d641 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/physical_fine_volume.png differ diff --git a/app/src/main/res/drawable-xhdpi/physical_lab.png b/app/src/main/res/drawable-xhdpi/physical_lab.png new file mode 100644 index 0000000..32cafab Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/physical_lab.png differ diff --git a/app/src/main/res/drawable-xhdpi/physical_synchronous_explanation.png b/app/src/main/res/drawable-xhdpi/physical_synchronous_explanation.png new file mode 100644 index 0000000..9bc2ff5 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/physical_synchronous_explanation.png differ diff --git a/app/src/main/res/drawable-xhdpi/physical_unit_tests.png b/app/src/main/res/drawable-xhdpi/physical_unit_tests.png new file mode 100644 index 0000000..f5102be Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/physical_unit_tests.png differ diff --git a/app/src/main/res/drawable-xhdpi/weather2.png b/app/src/main/res/drawable-xhdpi/weather2.png deleted file mode 100644 index f5ebf6d..0000000 Binary files a/app/src/main/res/drawable-xhdpi/weather2.png and /dev/null differ diff --git a/app/src/main/res/drawable/custom_bg_ai.xml b/app/src/main/res/drawable/custom_bg_ai.xml index 7e885b0..0889185 100644 --- a/app/src/main/res/drawable/custom_bg_ai.xml +++ b/app/src/main/res/drawable/custom_bg_ai.xml @@ -3,11 +3,11 @@ xmlns:android="http://schemas.android.com/apk/res/android"> + android:color="@color/color_icon_background" /> + android:topLeftRadius="@dimen/dp_8" + android:topRightRadius="@dimen/dp_8" + android:bottomLeftRadius="@dimen/dp_8" + android:bottomRightRadius="@dimen/dp_8" /> \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_applist.xml b/app/src/main/res/layout-land/activity_applist.xml deleted file mode 100644 index fafea65..0000000 --- a/app/src/main/res/layout-land/activity_applist.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout-land/activity_contact.xml b/app/src/main/res/layout-land/activity_contact.xml deleted file mode 100644 index 806b8a0..0000000 --- a/app/src/main/res/layout-land/activity_contact.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_emergency.xml b/app/src/main/res/layout-land/activity_emergency.xml deleted file mode 100644 index 0aac31d..0000000 --- a/app/src/main/res/layout-land/activity_emergency.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_family_space.xml b/app/src/main/res/layout-land/activity_family_space.xml deleted file mode 100644 index 90bf84c..0000000 --- a/app/src/main/res/layout-land/activity_family_space.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 7c6882d..b2332fe 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@drawable/main_background" tools:context=".activity.main.MainActivity"> + app:tl_textsize="@dimen/sp_12" /> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/main_sliding_tab_layout" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_weather.xml b/app/src/main/res/layout-land/activity_weather.xml deleted file mode 100644 index f57a916..0000000 --- a/app/src/main/res/layout-land/activity_weather.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_biology.xml b/app/src/main/res/layout-land/fragment_biology.xml new file mode 100644 index 0000000..a8124f5 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_biology.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_chemical.xml b/app/src/main/res/layout-land/fragment_chemical.xml new file mode 100644 index 0000000..e303a1a --- /dev/null +++ b/app/src/main/res/layout-land/fragment_chemical.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_chinese.xml b/app/src/main/res/layout-land/fragment_chinese.xml new file mode 100644 index 0000000..a7262fb --- /dev/null +++ b/app/src/main/res/layout-land/fragment_chinese.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_control.xml b/app/src/main/res/layout-land/fragment_control.xml deleted file mode 100644 index fcffc8c..0000000 --- a/app/src/main/res/layout-land/fragment_control.xml +++ /dev/null @@ -1,477 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_custom.xml b/app/src/main/res/layout-land/fragment_custom.xml deleted file mode 100644 index 9a2130d..0000000 --- a/app/src/main/res/layout-land/fragment_custom.xml +++ /dev/null @@ -1,594 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_custom_back.xml b/app/src/main/res/layout-land/fragment_custom_back.xml deleted file mode 100644 index 1eea6c1..0000000 --- a/app/src/main/res/layout-land/fragment_custom_back.xml +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_english.xml b/app/src/main/res/layout-land/fragment_english.xml new file mode 100644 index 0000000..0eee5bd --- /dev/null +++ b/app/src/main/res/layout-land/fragment_english.xml @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_math.xml b/app/src/main/res/layout-land/fragment_math.xml new file mode 100644 index 0000000..69167a4 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_math.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_physics.xml b/app/src/main/res/layout-land/fragment_physics.xml new file mode 100644 index 0000000..e75c554 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_physics.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/fragment_second.xml b/app/src/main/res/layout-land/fragment_second.xml deleted file mode 100644 index 864d397..0000000 --- a/app/src/main/res/layout-land/fragment_second.xml +++ /dev/null @@ -1,608 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/item_app.xml b/app/src/main/res/layout-land/item_app.xml deleted file mode 100644 index c1faa54..0000000 --- a/app/src/main/res/layout-land/item_app.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/item_contact.xml b/app/src/main/res/layout-land/item_contact.xml deleted file mode 100644 index 51baa0d..0000000 --- a/app/src/main/res/layout-land/item_contact.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-land/item_weather.xml b/app/src/main/res/layout-land/item_weather.xml deleted file mode 100644 index db8cef0..0000000 --- a/app/src/main/res/layout-land/item_weather.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/activity_applist.xml b/app/src/main/res/layout-port/activity_applist.xml deleted file mode 100644 index fafea65..0000000 --- a/app/src/main/res/layout-port/activity_applist.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout-port/activity_contact.xml b/app/src/main/res/layout-port/activity_contact.xml deleted file mode 100644 index 639ff2b..0000000 --- a/app/src/main/res/layout-port/activity_contact.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/activity_emergency.xml b/app/src/main/res/layout-port/activity_emergency.xml deleted file mode 100644 index 5cc0c5a..0000000 --- a/app/src/main/res/layout-port/activity_emergency.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/activity_family_space.xml b/app/src/main/res/layout-port/activity_family_space.xml deleted file mode 100644 index 90bf84c..0000000 --- a/app/src/main/res/layout-port/activity_family_space.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/activity_weather.xml b/app/src/main/res/layout-port/activity_weather.xml deleted file mode 100644 index 1892692..0000000 --- a/app/src/main/res/layout-port/activity_weather.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/fragment_control.xml b/app/src/main/res/layout-port/fragment_control.xml deleted file mode 100644 index aec34ff..0000000 --- a/app/src/main/res/layout-port/fragment_control.xml +++ /dev/null @@ -1,458 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/fragment_custom.xml b/app/src/main/res/layout-port/fragment_custom.xml deleted file mode 100644 index c8b791f..0000000 --- a/app/src/main/res/layout-port/fragment_custom.xml +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/fragment_second.xml b/app/src/main/res/layout-port/fragment_second.xml deleted file mode 100644 index 93f82b2..0000000 --- a/app/src/main/res/layout-port/fragment_second.xml +++ /dev/null @@ -1,596 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/item_app.xml b/app/src/main/res/layout-port/item_app.xml deleted file mode 100644 index c1faa54..0000000 --- a/app/src/main/res/layout-port/item_app.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/item_contact.xml b/app/src/main/res/layout-port/item_contact.xml deleted file mode 100644 index d16f2fe..0000000 --- a/app/src/main/res/layout-port/item_contact.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout-port/item_weather.xml b/app/src/main/res/layout-port/item_weather.xml deleted file mode 100644 index 63c8c08..0000000 --- a/app/src/main/res/layout-port/item_weather.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_alarm_clock.xml b/app/src/main/res/layout/activity_alarm_clock.xml deleted file mode 100644 index 98cdb62..0000000 --- a/app/src/main/res/layout/activity_alarm_clock.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_notice.xml b/app/src/main/res/layout/activity_notice.xml deleted file mode 100644 index 9f9d31c..0000000 --- a/app/src/main/res/layout/activity_notice.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -