commit 6c2eb5a1a3306f7a1c512aaf1f4724bb2a36ac58 Author: tongtongstudio Date: Fri Dec 3 17:46:59 2021 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3aa2f13 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +/app/src/androidTest/java/com/uiui/os/ +/app/src/test/java/com/uiui/os/ +/.idea/ diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..6051bec --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,151 @@ +apply plugin: 'com.android.application' + +def appName() { + return "学习系统" +} + +def releaseTime() { + return new Date().format("yyyyMMddHHmmss", TimeZone.getDefault()) +} + +android { + compileSdkVersion 29 + + defaultConfig { + applicationId "com.uiui.os" + minSdkVersion 24 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + signingConfigs { + zhanRui { + storeFile file("src/doc/zhanxun.keystore") + storePassword "123456" + keyAlias "zhanxun" + keyPassword "123456" + v1SigningEnabled true + v2SigningEnabled true + } + debug { + storeFile file("src/doc/xueshibaoos.jks") + storePassword "123456" + keyAlias "xueshibaoos" + keyPassword "123456" + v2SigningEnabled false + } + release {// 签名文件 + storeFile file("src/doc/xueshibaoos.jks") + storePassword "123456" + keyAlias "xueshibaoos" + keyPassword "123456" + v2SigningEnabled false + } + } + + buildTypes { + zhanRuiRelease.initWith(release) + zhanRuiRelease { + manifestPlaceholders = [ + AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9" + ] + buildConfigField "boolean", "LOG_DEBUG", "false" + signingConfig signingConfigs.zhanRui + } + + zhanRuiDebug.initWith(debug) + zhanRuiDebug { + manifestPlaceholders = [ + AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9" + ] + buildConfigField "boolean", "LOG_DEBUG", "true" + versionNameSuffix "-debug" + debuggable true + signingConfig signingConfigs.zhanRui + } + debug { + manifestPlaceholders = [ + AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9" + ] + // 显示Log + buildConfigField "boolean", "LOG_DEBUG", "true" + versionNameSuffix "-debug" + minifyEnabled false + //Zipalign优化 + zipAlignEnabled true + signingConfig signingConfigs.debug + applicationVariants.all { variant -> + variant.outputs.each { output -> + if (outputFile != null) { + def fileName = "${appName()}-V${defaultConfig.versionName}-${releaseTime()}.apk" + output.outputFileName = fileName + } + } + } + } + release { + manifestPlaceholders = [ + AMAP_KEY: "70f37634f84b00c5c7347c545bc2a3b9" + ] + // 不显示Log + buildConfigField "boolean", "LOG_DEBUG", "false" + //混淆 + minifyEnabled false + //Zipalign优化 + zipAlignEnabled true + //前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件 + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + //签名 + signingConfig signingConfigs.release +// 将release版本的包名重命名,加上版本及日期 + applicationVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = "" + if (outputFile != null) { + def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk" + output.outputFileName = new File(outputFile, fileName) + + } + } + } + } + } + + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation files('libs/QWeather_Public_Android_V4.6.jar') + + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation "androidx.recyclerview:recyclerview:1.2.1" + // For control over item selection of both touch and mouse driven selection + implementation "androidx.recyclerview:recyclerview-selection:1.1.0" + implementation "androidx.viewpager2:viewpager2:1.0.0" + // Java language implementation + implementation "androidx.fragment:fragment:1.3.6" + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + implementation 'com.squareup.okhttp3:okhttp:3.12.12' + implementation 'com.google.code.gson:gson:2.6.2' + //bindView + implementation 'com.jakewharton:butterknife:10.1.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' + //高德地图定位 + implementation 'com.amap.api:location:5.1.0' + //MMKV + implementation 'com.tencent:mmkv-static:1.2.10' + //状态栏透明 + implementation 'com.gitee.zackratos:UltimateBarX:0.7.1' + //指示器 + implementation 'com.github.hackware1993:MagicIndicator:1.7.0' // for androidx + implementation 'com.king.view:circleprogressview:1.1.2' +} diff --git a/app/libs/QWeather_Public_Android_V4.6.jar b/app/libs/QWeather_Public_Android_V4.6.jar new file mode 100644 index 0000000..046cfb7 Binary files /dev/null and b/app/libs/QWeather_Public_Android_V4.6.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/doc/xueshibaoos.jks b/app/src/doc/xueshibaoos.jks new file mode 100644 index 0000000..b94a626 Binary files /dev/null and b/app/src/doc/xueshibaoos.jks differ diff --git a/app/src/doc/zhanxun.keystore b/app/src/doc/zhanxun.keystore new file mode 100644 index 0000000..7c46fbc Binary files /dev/null and b/app/src/doc/zhanxun.keystore differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..95b824c --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl b/app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl new file mode 100644 index 0000000..3d39497 --- /dev/null +++ b/app/src/main/aidl/com/alarmclock/uiui/IAlarmAidlInterface.aidl @@ -0,0 +1,14 @@ +// IAlarmAidlInterface.aidl +package com.alarmclock.uiui; + +// Declare any non-default types here with import statements + +interface IAlarmAidlInterface { + /** + * 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(); +} diff --git a/app/src/main/java/com/uiui/os/AppInfo.java b/app/src/main/java/com/uiui/os/AppInfo.java new file mode 100644 index 0000000..ecfedeb --- /dev/null +++ b/app/src/main/java/com/uiui/os/AppInfo.java @@ -0,0 +1,9 @@ +package com.uiui.os; + +import java.io.Serializable; + +public class AppInfo implements Serializable { + + private static final long serialVersionUID = -5488458740561098181L; + +} diff --git a/app/src/main/java/com/uiui/os/activity/MainActivity.java b/app/src/main/java/com/uiui/os/activity/MainActivity.java new file mode 100644 index 0000000..e694912 --- /dev/null +++ b/app/src/main/java/com/uiui/os/activity/MainActivity.java @@ -0,0 +1,270 @@ +package com.uiui.os.activity; + +import android.content.BroadcastReceiver; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.ServiceConnection; +import android.content.pm.ApplicationInfo; +import android.content.res.Configuration; +import android.graphics.Color; +import android.os.IBinder; +import android.os.RemoteException; +import android.text.TextUtils; +import android.util.Log; +import android.view.KeyEvent; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.viewpager.widget.ViewPager; + +import com.alarmclock.uiui.IAlarmAidlInterface; +import com.amap.api.location.AMapLocation; +import com.amap.api.location.AMapLocationClient; +import com.amap.api.location.AMapLocationListener; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.qweather.sdk.bean.base.Code; +import com.qweather.sdk.bean.base.Lang; +import com.qweather.sdk.bean.base.Unit; +import com.qweather.sdk.bean.weather.WeatherNowBean; +import com.qweather.sdk.view.QWeather; +import com.uiui.os.R; +import com.uiui.os.base.BaseActivity; +import com.uiui.os.bean.AlarmItem; +import com.uiui.os.fragment.AppListFragment; +import com.uiui.os.fragment.BaseFragmentPagerAdapter; +import com.uiui.os.fragment.CustomFragment; +import com.uiui.os.utils.AmapManager; +import com.uiui.os.utils.ApkUtils; +import com.uiui.os.view.ScaleCircleNavigator; + +import net.lucode.hackware.magicindicator.MagicIndicator; +import net.lucode.hackware.magicindicator.ViewPagerHelper; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +import butterknife.BindView; +import butterknife.ButterKnife; + +public class MainActivity extends BaseActivity { + private String TAG = MainActivity.class.getSimpleName(); + + @BindView(R.id.viewPager) + ViewPager viewPager; + @BindView(R.id.magicIndicator) + MagicIndicator magicIndicator; + + private FragmentManager fragmentManager; + private FragmentTransaction fragmentTransaction; + private BaseFragmentPagerAdapter adapter; + private List fragments; + private CustomFragment customFragment; + + @Override + public int getLayoutId() { + return R.layout.activity_main; + } + + @Override + public void initView() { + ButterKnife.bind(this); + fragmentManager = getSupportFragmentManager(); + fragmentTransaction = fragmentManager.beginTransaction(); + fragments = new ArrayList<>(); + adapter = new BaseFragmentPagerAdapter(fragmentManager, fragments); +// fragmentTransaction.add(R.id.viewPager, appListFragment); +// fragmentTransaction.commit(); + customFragment = new CustomFragment(); + mAlarmServiceConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + Log.e(TAG, "onServiceConnected: "); + mIAlarmAidlInterface = IAlarmAidlInterface.Stub.asInterface(service); + getAlarmData(); + } + + @Override + public void onServiceDisconnected(ComponentName name) { + Log.e(TAG, "onServiceDisconnected: "); + mIAlarmAidlInterface = null; + } + }; + bindAlarmService(); + } + + private void getAlarmData() { + if (mIAlarmAidlInterface == null) { + bindAlarmService(); + return; + } + try { + String json = mIAlarmAidlInterface.getAlarm(); + Log.e(TAG, "onServiceConnected: " + json); + if (json.equalsIgnoreCase("暂无闹钟")) { + customFragment.setAlarmItem(null); + return; + } + Type type = new TypeToken() { + }.getType(); + AlarmItem alarmItem = new Gson().fromJson(json, type); + customFragment.setAlarmItem(alarmItem); + } catch (RemoteException e) { + e.printStackTrace(); + } + } + + 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 { + + } + } + + private final static int APP_LIST_SIZE = 12; + + @Override + public void initData() { + registmNewAppReceiver(); + fragments.add(customFragment); + ArrayList applicationInfoList = ApkUtils.queryFilterAppInfo(this); + int x = 0; + for (int i = 0; i <= applicationInfoList.size(); i++) { + if (i != 0 && i % APP_LIST_SIZE == 0) { + AppListFragment appListFragment = new AppListFragment(); + appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i))); + fragments.add(appListFragment); + x = i; + } else if (i == applicationInfoList.size()) { + AppListFragment appListFragment = new AppListFragment(); + fragments.add(appListFragment); + appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i))); + } + } + viewPager.setAdapter(adapter); + ScaleCircleNavigator scaleCircleNavigator = new ScaleCircleNavigator(this); + scaleCircleNavigator.setCircleCount(fragments.size()); + scaleCircleNavigator.setNormalCircleColor(Color.DKGRAY); + scaleCircleNavigator.setSelectedCircleColor(Color.LTGRAY); + scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() { + @Override + public void onClick(int index) { + + } + }); + magicIndicator.setNavigator(scaleCircleNavigator); + ViewPagerHelper.bind(magicIndicator, viewPager); + if (fragments.size() > 1) { + viewPager.setCurrentItem(1); + } + } + + private void addData() { + List fragmentList = new ArrayList<>(); + ArrayList applicationInfoList = ApkUtils.queryFilterAppInfo(this); + int x = 0; + for (int i = 0; i <= applicationInfoList.size(); i++) { + if (i != 0 && i % APP_LIST_SIZE == 0) { + AppListFragment appListFragment = new AppListFragment(); + appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i))); + fragmentList.add(appListFragment); + x = i; + } else if (i == applicationInfoList.size()) { + AppListFragment appListFragment = new AppListFragment(); + fragmentList.add(appListFragment); + appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i))); + } + } + for (int i = 1; i <= fragmentList.size(); i++) { + if (fragments.get(i) != null) { + adapter.replaceFragment(i, fragmentList.get(i - 1)); + fragments.remove(i); + fragments.add(i, fragmentList.get(i - 1)); + } else { + adapter.addFragment(fragmentList.get(i - 1)); + fragments.add(fragmentList.get(i - 1)); + } + } + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { + return false; + } + return super.onKeyDown(keyCode, event); + } + + @Override + protected void onNewIntent(Intent intent) { + super.onNewIntent(intent); + Log.e(TAG, "onNewIntent: " + intent.getAction()); + String action = intent.getAction(); + if (TextUtils.isEmpty(action)) { + return; + } + switch (action) { + default: + break; + case Intent.ACTION_MAIN: + viewPager.setCurrentItem(1); + break; + } + } + + @Override + public void onConfigurationChanged(@NonNull Configuration newConfig) { + super.onConfigurationChanged(newConfig); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + if (mNewAppReceiver != null) { + unregisterReceiver(mNewAppReceiver); + } + } + + private NewAppReceiver mNewAppReceiver; + + @Override + protected void onResume() { + super.onResume(); + getAlarmData(); + } + + private void registmNewAppReceiver() { + mNewAppReceiver = new NewAppReceiver(); + IntentFilter filter = new IntentFilter(); + filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY); + filter.addAction(Intent.ACTION_PACKAGE_ADDED); + filter.addAction(Intent.ACTION_PACKAGE_REPLACED); + filter.addAction(Intent.ACTION_PACKAGE_REMOVED); + filter.addDataScheme("package"); + registerReceiver(mNewAppReceiver, filter); + } + + class NewAppReceiver extends BroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + Log.e(TAG, "onReceive: " + action); + addData(); + } + } +} diff --git a/app/src/main/java/com/uiui/os/base/BaseActivity.java b/app/src/main/java/com/uiui/os/base/BaseActivity.java new file mode 100644 index 0000000..84cc88d --- /dev/null +++ b/app/src/main/java/com/uiui/os/base/BaseActivity.java @@ -0,0 +1,55 @@ +package com.uiui.os.base; + +import android.os.Bundle; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.uiui.os.R; +import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX; + +public abstract class BaseActivity extends AppCompatActivity { + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setBar(); + //状态栏改变放在setContentView前后有所不同 + setContentView(this.getLayoutId()); + initView(); + initData(); + } + + private void setBar() { + UltimateBarX.statusBar(this) + .transparent() + .colorRes(R.color.colorPrimaryDark) +// .light(true) + .apply(); + UltimateBarX.navigationBar(this) + .transparent() + .colorRes(R.color.colorPrimaryDark) +// .light(true) + .apply(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } + + /** + * 设置布局 + */ + public abstract int getLayoutId(); + + /** + * 初始化视图 + */ + public abstract void initView(); + + + /** + * 初始化数据 + */ + public abstract void initData(); +} diff --git a/app/src/main/java/com/uiui/os/base/BaseApplication.java b/app/src/main/java/com/uiui/os/base/BaseApplication.java new file mode 100644 index 0000000..32e21c6 --- /dev/null +++ b/app/src/main/java/com/uiui/os/base/BaseApplication.java @@ -0,0 +1,70 @@ +package com.uiui.os.base; + +import android.annotation.SuppressLint; +import android.app.Application; +import android.content.Context; +import android.os.Handler; +import android.os.Looper; +import android.util.Log; + +import com.qweather.sdk.view.HeConfig; +import com.uiui.os.utils.AmapManager; + + +public class BaseApplication extends Application { + private static final String TAG = BaseApplication.class.getSimpleName(); + + @SuppressLint("StaticFieldLeak") + public static Context context; + @SuppressLint("StaticFieldLeak") + private static BaseApplication instance; + + public static Context getAppContext() { + return context; + } + + // 单例模式中获取唯一的ExitApplication实例 + public static BaseApplication getInstance() { + if (null == instance) { + instance = new BaseApplication(); + } + return instance; + } + + @Override + public void onCreate() { + super.onCreate(); + context = this; + HeConfig.init("HE2111041506381545", "32b5ec69545e44119583a5e0ed4e87df"); + AmapManager.init(this); + } + + + private void catchException() { + Thread.setDefaultUncaughtExceptionHandler( + new Thread.UncaughtExceptionHandler() { + @Override + public void uncaughtException(Thread t, Throwable e) { + Log.e("捕获异常子线程:", Thread.currentThread().getName() + + "在:" + e.getStackTrace()[0].getClassName()); + } + } + ); + //下面是新增方法! + new Handler(Looper.getMainLooper()).post(new Runnable() { + @Override + public void run() { + while (true) { + try { + Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法! + } catch (Exception e) { + Log.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName()); + e.printStackTrace(); + } + } + } + }); + } + + +} diff --git a/app/src/main/java/com/uiui/os/bean/AlarmItem.java b/app/src/main/java/com/uiui/os/bean/AlarmItem.java new file mode 100644 index 0000000..1f6393b --- /dev/null +++ b/app/src/main/java/com/uiui/os/bean/AlarmItem.java @@ -0,0 +1,21 @@ +package com.uiui.os.bean; + +import java.io.Serializable; + +public class AlarmItem implements Serializable { + private static final long serialVersionUID = -2760428066543837757L; + public String mTitle; + public String mTime; + public String mRepeatType; + public String mRepeatCode; + public boolean mActive; + + public AlarmItem(String time, String repeatNormal, String repeatDefine, boolean active) { +// this.mTitle = title; + this.mTime = time; + this.mRepeatType = repeatNormal; + this.mRepeatCode = repeatDefine; + this.mActive = active; + + } +} diff --git a/app/src/main/java/com/uiui/os/fragment/AppListFragment.java b/app/src/main/java/com/uiui/os/fragment/AppListFragment.java new file mode 100644 index 0000000..8338a45 --- /dev/null +++ b/app/src/main/java/com/uiui/os/fragment/AppListFragment.java @@ -0,0 +1,166 @@ +package com.uiui.os.fragment; + +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.res.Configuration; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.core.app.NavUtils; +import androidx.fragment.app.Fragment; + +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.uiui.os.R; +import com.uiui.os.utils.ApkUtils; +import com.uiui.os.utils.BitmapUtils; +import com.uiui.os.utils.IconUtils; +import com.uiui.os.view.MyGridLayout; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * A simple {@link Fragment} subclass. + * Use the {@link AppListFragment#newInstance} factory method to + * create an instance of this fragment. + */ +public class AppListFragment 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; + + private ArrayList applicationInfos; + private MyGridLayout gridLayout; + private String TAG = AppListFragment.class.getSimpleName(); + + public AppListFragment() { + // 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 AppListFragment. + */ + // TODO: Rename and change types and number of parameters + public static AppListFragment newInstance(String param1, String param2) { + AppListFragment fragment = new AppListFragment(); + 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 (savedInstanceState != null) { + applicationInfos = savedInstanceState.getParcelableArrayList("applicationInfos"); + } + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + } + + private View rootView; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // Inflate the layout for this fragment + rootView = inflater.inflate(R.layout.fragment_applist, container, false); + initView(); + return rootView; + } + + private void initView() { + if (applicationInfos.size() != 12) { + applicationInfos.addAll(new ArrayList<>(Arrays.asList(new ApplicationInfo[12 - applicationInfos.size()]))); + } + gridLayout = rootView.findViewById(R.id.list); + if (getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { + gridLayout.set(4, 3); + } else { + gridLayout.set(3, 4); + } + + gridLayout.setGridAdapter(new MyGridLayout.GridAdatper() { + @Override + public View getView(int index) { + PackageManager pm = rootView.getContext().getPackageManager(); + View view = getLayoutInflater().inflate(R.layout.actions_item, + null); + ImageView iv = view.findViewById(R.id.iv); + TextView tv = view.findViewById(R.id.tv); + LinearLayout linearLayout = view.findViewById(R.id.btn_booktag); + ApplicationInfo applicationInfo = applicationInfos.get(index); + + if (applicationInfo != null) { + Log.e(TAG, "getView: " + applicationInfo.packageName); + int i = IconUtils.appClassNameList.indexOf(applicationInfo.packageName); + if (i != -1) { + String val = IconUtils.appIconList.get(i); + int resID = getActivity().getResources().getIdentifier(val, "drawable", "com.uiui.os"); + if (resID == 0) { + iv.setImageDrawable(applicationInfo.loadIcon(pm)); + } else { + iv.setImageDrawable(getActivity().getResources().getDrawable(resID)); + } + } else { + iv.setImageBitmap(BitmapUtils.getIconBitmap(rootView.getContext(), applicationInfo.loadIcon(pm))); + } + tv.setText(applicationInfo.loadLabel(pm)); +// linearLayout.setEnabled(true); + } else { +// linearLayout.setEnabled(false); + } + + return view; + } + + @Override + public int getCount() { +// return applicationInfos == null ? 0 : applicationInfos.size(); + return applicationInfos.size(); + } + }); + gridLayout.setApplicationInfos(applicationInfos); + gridLayout.setOnItemClickListener(new MyGridLayout.OnItemClickListener() { + @Override + public void onItemClick(View v, int index) { + ApplicationInfo applicationInfo = applicationInfos.get(index); + if (applicationInfo != null) { + ApkUtils.openPackage(v.getContext(), applicationInfo.packageName); + } + } + }); + } + + public void setAppList(ArrayList appList) { + this.applicationInfos = appList; + } + + @Override + public void onSaveInstanceState(@NonNull Bundle outState) { + outState.putParcelableArrayList("applicationInfos", applicationInfos); + super.onSaveInstanceState(outState); + } +} diff --git a/app/src/main/java/com/uiui/os/fragment/BaseFragmentPagerAdapter.java b/app/src/main/java/com/uiui/os/fragment/BaseFragmentPagerAdapter.java new file mode 100644 index 0000000..56b04bc --- /dev/null +++ b/app/src/main/java/com/uiui/os/fragment/BaseFragmentPagerAdapter.java @@ -0,0 +1,204 @@ +package com.uiui.os.fragment; + +import android.util.SparseArray; + +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.fragment.app.FragmentTransaction; + +import java.util.List; + +/** + * 加载显示Fragment的ViewPagerAdapter基类 + * 提供可以刷新的方法 + * + * @author Fly + * @e-mail 1285760616@qq.com + * @time 2018/3/22 + */ +public class BaseFragmentPagerAdapter extends FragmentPagerAdapter { + private List mFragmentList; + private FragmentManager mFragmentManager; + /**下面两个值用来保存Fragment的位置信息,用以判断该位置是否需要更新*/ + private SparseArray mFragmentPositionMap; + private SparseArray mFragmentPositionMapAfterUpdate; + + public BaseFragmentPagerAdapter(FragmentManager fm, List fragments) { + super(fm); + mFragmentList = fragments; + mFragmentManager = fm; + mFragmentList = fragments; + mFragmentPositionMap = new SparseArray<>(); + mFragmentPositionMapAfterUpdate = new SparseArray<>(); + setFragmentPositionMap(); + setFragmentPositionMapForUpdate(); + } + + /** + * 保存更新之前的位置信息,用的键值对结构来保存 + */ + private void setFragmentPositionMap() { + mFragmentPositionMap.clear(); + for (int i = 0; i < mFragmentList.size(); i++) { + mFragmentPositionMap.put(Long.valueOf(getItemId(i)).intValue(), String.valueOf(i)); + } + } + + /** + * 保存更新之后的位置信息,用的键值对结构来保存 + */ + private void setFragmentPositionMapForUpdate() { + mFragmentPositionMapAfterUpdate.clear(); + for (int i = 0; i < mFragmentList.size(); i++) { + mFragmentPositionMapAfterUpdate.put(Long.valueOf(getItemId(i)).intValue(), String.valueOf(i)); + } + } + + /** + * 在此方法中找到需要更新的位置返回POSITION_NONE,否则返回POSITION_UNCHANGED即可 + */ + @Override + public int getItemPosition(Object object) { + int hashCode = object.hashCode(); + //查找object在更新后的列表中的位置 + String position = mFragmentPositionMapAfterUpdate.get(hashCode); + //更新后的列表中不存在该object的位置了 + if (position == null) { + return POSITION_NONE; + } else { + //如果更新后的列表中存在该object的位置, 查找该object之前的位置并判断位置是否发生了变化 + int size = mFragmentPositionMap.size(); + for (int i = 0; i < size ; i++) { + int key = mFragmentPositionMap.keyAt(i); + if (key == hashCode) { + String index = mFragmentPositionMap.get(key); + if (position.equals(index)) { + //位置没变依然返回POSITION_UNCHANGED + return POSITION_UNCHANGED; + } else { + //位置变了 + return POSITION_NONE; + } + } + } + } + return POSITION_UNCHANGED; + } + + /** + * 将指定的Fragment替换/更新为新的Fragment + * @param oldFragment 旧Fragment + * @param newFragment 新Fragment + */ + public void replaceFragment(Fragment oldFragment, Fragment newFragment) { + int position = mFragmentList.indexOf(oldFragment); + if (position == -1) { + return; + } + //从Transaction移除旧的Fragment + removeFragmentInternal(oldFragment); + //替换List中对应的Fragment + mFragmentList.set(position, newFragment); + //刷新Adapter + notifyItemChanged(); + } + + /** + * 将指定位置的Fragment替换/更新为新的Fragment,同{@link #replaceFragment(Fragment oldFragment, Fragment newFragment)} + * @param position 旧Fragment的位置 + * @param newFragment 新Fragment + */ + public void replaceFragment(int position, Fragment newFragment) { + Fragment oldFragment = mFragmentList.get(position); + removeFragmentInternal(oldFragment); + mFragmentList.set(position, newFragment); + notifyItemChanged(); + } + + /** + * 移除指定的Fragment + * @param fragment 目标Fragment + */ + public void removeFragment(Fragment fragment) { + //先从List中移除 + mFragmentList.remove(fragment); + //然后从Transaction移除 + removeFragmentInternal(fragment); + //最后刷新Adapter + notifyItemChanged(); + } + + /** + * 移除指定位置的Fragment,同 {@link #removeFragment(Fragment fragment)} + * @param position + */ + public void removeFragment(int position) { + Fragment fragment = mFragmentList.get(position); + //然后从List中移除 + mFragmentList.remove(fragment); + //先从Transaction移除 + removeFragmentInternal(fragment); + //最后刷新Adapter + notifyItemChanged(); + } + + /** + * 添加Fragment + * @param fragment 目标Fragment + */ + public void addFragment(Fragment fragment) { + mFragmentList.add(fragment); + notifyItemChanged(); + } + + /** + * 在指定位置插入一个Fragment + * @param position 插入位置 + * @param fragment 目标Fragment + */ + public void insertFragment(int position, Fragment fragment) { + mFragmentList.add(position, fragment); + notifyItemChanged(); + } + + private void notifyItemChanged() { + //刷新之前重新收集位置信息 + setFragmentPositionMapForUpdate(); + notifyDataSetChanged(); + setFragmentPositionMap(); + } + + /** + * 从Transaction移除Fragment + * @param fragment 目标Fragment + */ + private void removeFragmentInternal(Fragment fragment) { + FragmentTransaction transaction = mFragmentManager.beginTransaction(); + transaction.remove(fragment); + transaction.commitNow(); + } + + /** + * 此方法不用position做返回值即可破解fragment tag异常的错误 + */ + @Override + public long getItemId(int position) { + // 获取当前数据的hashCode,其实这里不用hashCode用自定义的可以关联当前Item对象的唯一值也可以,只要不是直接返回position + return mFragmentList.get(position).hashCode(); + } + + @Override + public Fragment getItem(int position) { + return mFragmentList.get(position); + } + + @Override + public int getCount() { + return mFragmentList.size(); + } + + public List getFragments() { + return mFragmentList; + } +} diff --git a/app/src/main/java/com/uiui/os/fragment/CustomFragment.java b/app/src/main/java/com/uiui/os/fragment/CustomFragment.java new file mode 100644 index 0000000..065ebf4 --- /dev/null +++ b/app/src/main/java/com/uiui/os/fragment/CustomFragment.java @@ -0,0 +1,343 @@ +package com.uiui.os.fragment; + +import android.app.ActivityManager; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.BatteryManager; +import android.os.Bundle; + +import androidx.constraintlayout.widget.ConstraintLayout; +import androidx.fragment.app.Fragment; + +import android.os.SystemClock; +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 com.amap.api.location.AMapLocation; +import com.amap.api.location.AMapLocationClient; +import com.amap.api.location.AMapLocationListener; +import com.google.gson.Gson; +import com.king.view.circleprogressview.CircleProgressView; +import com.qweather.sdk.bean.base.Code; +import com.qweather.sdk.bean.base.Lang; +import com.qweather.sdk.bean.base.Unit; +import com.qweather.sdk.bean.weather.WeatherNowBean; +import com.qweather.sdk.view.QWeather; +import com.uiui.os.BuildConfig; +import com.uiui.os.R; +import com.uiui.os.bean.AlarmItem; +import com.uiui.os.utils.AmapManager; +import com.uiui.os.utils.ApkUtils; +import com.uiui.os.utils.AppUtil; +import com.uiui.os.utils.Utils; + +import java.lang.reflect.Method; +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 Fragment { + private String TAG = CustomFragment.class.getSimpleName(); + + private TextView tv_time,tv_add, tv_type, tv_status; + private ImageView iv_pic; + private TextView tv_temp; + private TextView tv_battery; + private TextView tv_location; + private CircleProgressView cpv; + private ConstraintLayout cl_alarm; + private ImageView iv_charging; + private int[] mShaderColors = new int[]{0xFFfa3db5, 0xFFF8867E, 0xFFF79F6B, 0xFFF79F6B, 0xFFF79F6B, 0xFFF8867E, 0xFFfa3db5}; + + + // 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; + + private View rootView; + private AlarmItem alarmItem; + + 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(AlarmItem item) { + this.alarmItem = item; + setAlarm(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (getArguments() != null) { + mParam1 = getArguments().getString(ARG_PARAM1); + mParam2 = getArguments().getString(ARG_PARAM2); + } + registerBatteryReceiver(); + getActivity().registerReceiver(mbatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); + } + + 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); + getActivity().registerReceiver(batteryReceiver, filter); + } + + 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.e(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.e(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); + } + } + } + } + }; + + @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); + initView(); + initData(); + return rootView; + } + + private void initView() { + tv_time = rootView.findViewById(R.id.tv_time); + tv_add = rootView.findViewById(R.id.tv_add); + tv_type = rootView.findViewById(R.id.tv_type); + tv_status = rootView.findViewById(R.id.tv_status); + + iv_pic = rootView.findViewById(R.id.iv_pic); + tv_temp = rootView.findViewById(R.id.tv_temp); + tv_location = rootView.findViewById(R.id.tv_location); + tv_battery = rootView.findViewById(R.id.tv_battery); + Log.e(TAG, "initView: " + Utils.getBatteryLevel(getActivity())); + tv_battery.setText(Utils.getBatteryLevel(getActivity()) + "%"); + cpv = rootView.findViewById(R.id.cpv); + cpv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + killBackgroundApp(); + } + }); + cl_alarm = rootView.findViewById(R.id.cl_alarm); + cl_alarm.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + ApkUtils.openPackage(getActivity(), "com.alarmclock.uiui"); + } + }); + iv_charging = rootView.findViewById(R.id.iv_charging); + setAlarm(); + refreshMemory(); + } + + private void setAlarm() { + if (rootView == null) return; + if (alarmItem == null) { + tv_time.setText("暂无闹钟"); + tv_time.setVisibility(View.GONE); + tv_add.setVisibility(View.VISIBLE); + tv_type.setVisibility(View.GONE); + tv_status.setVisibility(View.GONE); + } else { + tv_time.setText(alarmItem.mTime); + tv_time.setVisibility(View.VISIBLE); + tv_add.setVisibility(View.GONE); + tv_type.setText(alarmItem.mRepeatType); + tv_type.setVisibility(View.VISIBLE); + tv_status.setVisibility(View.VISIBLE); + if (alarmItem.mActive) { + tv_status.setText("打开"); + } else { + tv_status.setText("关闭"); + } + } + } + + private void initData() { + initAmap(); + } + + private void initAmap() { + AMapLocationClient aMapLocationClient = AmapManager.getInstance().getLocationClient(); + aMapLocationClient.stopLocation(); + aMapLocationClient.startLocation(); + aMapLocationClient.setLocationListener(new AMapLocationListener() { + @Override + public void onLocationChanged(AMapLocation aMapLocation) { + Log.e(TAG, "onLocationChanged: " + aMapLocation); + if (aMapLocation.getErrorCode() == 0) { + String city = aMapLocation.getCity(); + getweather(aMapLocation.getLongitude(), aMapLocation.getLatitude()); + tv_location.setText(city); + } else { + + } + } + }); + } + + private void getweather(double longitude, double latitude) { + /** + * 实况天气数据 + * @param location 所查询的地区,可通过该地区名称、ID、IP和经纬度进行查询经纬度格式:经度,纬度 + * (英文,分隔,十进制格式,北纬东经为正,南纬西经为负) + * @param lang (选填)多语言,可以不使用该参数,默认为简体中文 + * @param unit (选填)单位选择,公制(m)或英制(i),默认为公制单位 + * @param listener 网络访问结果回调 + */ + + QWeather.getWeatherNow(getActivity(), "" + longitude + "," + latitude, Lang.ZH_HANS, Unit.METRIC, new QWeather.OnResultWeatherNowListener() { + @Override + public void onError(Throwable e) { + Log.e(TAG, "getWeather onError: " + e); + } + + @Override + public void onSuccess(WeatherNowBean weatherBean) { + Log.e(TAG, "getWeather onSuccess: " + new Gson().toJson(weatherBean)); + //先判断返回的status是否正确,当status正确时获取数据,若status不正确,可查看status对应的Code值找到原因 + if (Code.OK == weatherBean.getCode()) { + WeatherNowBean.NowBaseBean now = weatherBean.getNow(); + String imageName = "he" + now.getIcon(); +// int resId = getResources().getIdentifier(imageName, "drawable", getActivity().getPackageName()); +// iv_pic.setImageDrawable(getActivity().getDrawable(resId)); + tv_temp.setText(now.getTemp() + "℃"); + } else { + //在此查看返回数据失败的原因 + Code code = weatherBean.getCode(); + Log.e(TAG, "failed code: " + code); + } + } + }); + } + + + private void killBackgroundApp() { + List pkgList = ApkUtils.queryFilterAppList(getActivity()); + for (String pkg : pkgList) { + if (pkg.equalsIgnoreCase(BuildConfig.APPLICATION_ID)) continue; + killBackgroundProcesses(pkg); + } + } + + private void killBackgroundProcesses(String packageName) { + ActivityManager activityManager; + try { + activityManager = (ActivityManager) + getActivity().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(); + } + refreshMemory(); + } + + private void refreshMemory() { + long avail = AppUtil.getAvailMemory(getActivity()); + long total = AppUtil.getTotalMemory(getActivity()); + int x = (int) (((total - avail) / (double) total) * 100); + cpv.setProgressColor(mShaderColors); + cpv.showAnimation(0, x, 1000); + float x2 = (((total - avail) / (float) total)); + } + + + @Override + public void onDestroy() { + super.onDestroy(); + if (batteryReceiver != null) { + getActivity().unregisterReceiver(batteryReceiver); + } + if (mbatteryReceiver != null) { + getActivity().unregisterReceiver(mbatteryReceiver); + } + } +} diff --git a/app/src/main/java/com/uiui/os/utils/AmapManager.java b/app/src/main/java/com/uiui/os/utils/AmapManager.java new file mode 100644 index 0000000..183fa05 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/AmapManager.java @@ -0,0 +1,78 @@ +package com.uiui.os.utils; + +import android.content.Context; +import android.util.Log; + +import com.amap.api.location.AMapLocation; +import com.amap.api.location.AMapLocationClient; +import com.amap.api.location.AMapLocationClientOption; +import com.amap.api.location.AMapLocationListener; + +public class AmapManager { + private static AmapManager sInstance; + private Context mContext; + public static AMapLocationClient locationClient = null; + private String TAG = AmapManager.class.getSimpleName(); + + private AmapManager(Context context) { + this.mContext = context; + } + + public static void init(Context context) { + if (sInstance == null) { + sInstance = new AmapManager(context); + } + + } + + public static AmapManager getInstance() { + if (sInstance == null) { + throw new IllegalStateException("You must be init AmapManager first"); + } + + return sInstance; + } + + public AMapLocationClient getLocationClient() { + if (null == locationClient) { + initAmap(); + } + return locationClient; + } + + public void initAmap() { + locationClient = new AMapLocationClient(mContext); + AMapLocationClientOption option = new AMapLocationClientOption(); + option.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn); + option.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy); + option.setNeedAddress(true); + //获取一次定位结果: + //该方法默认为false。 + option.setOnceLocation(true); + //获取最近3s内精度最高的一次定位结果: + //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。 + // 如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。 + option.setOnceLocationLatest(true); + locationClient.setLocationOption(option); + //设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。 + //设置定位监听 + locationClient.setLocationListener(new AMapLocationListener() { + + @Override + public void onLocationChanged(AMapLocation aMapLocation) { + //errCode等于0代表定位成功,其他的为定位失败,具体的可以参照官网定位错误码说明 + if (aMapLocation.getErrorCode() == 0) { + Log.e(TAG, "onLocationChanged: " + "定位成功"); + Log.e(TAG, "onLocationChanged: " + aMapLocation.getAddress()); + } else { + //定位失败 + Log.e(TAG, "onLocationChanged: " + "定位失败"); + } + } + }); + //设置场景模式后最好调用一次stop,再调用start以保证场景模式生效 + locationClient.stopLocation(); + locationClient.startLocation(); + Log.e(TAG, "initAmap: " + "startLocation"); + } +} diff --git a/app/src/main/java/com/uiui/os/utils/ApkUtils.java b/app/src/main/java/com/uiui/os/utils/ApkUtils.java new file mode 100644 index 0000000..596a525 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/ApkUtils.java @@ -0,0 +1,141 @@ +package com.uiui.os.utils; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.text.TextUtils; +import android.util.Log; + +import com.uiui.os.BuildConfig; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class ApkUtils { + private static String[] excludePackageName = {BuildConfig.APPLICATION_ID}; + + + public static ArrayList queryFilterAppInfo(Context context) { + PackageManager pm = context.getPackageManager(); + // 查询所有已经安装的应用程序 + List appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除,但还有安装目录的 + ArrayList applicationInfos = new ArrayList<>(); + + // 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent + Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null); + resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER); + + // 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName + List resolveinfoList = pm.queryIntentActivities(resolveIntent, 0); + Set allowPackages = new HashSet(); + for (ResolveInfo resolveInfo : resolveinfoList) { + allowPackages.add(resolveInfo.activityInfo.packageName); + } + + for (ApplicationInfo app : appInfos) { +// if((app.flags & ApplicationInfo.FLAG_SYSTEM) <= 0)//通过flag排除系统应用,会将电话、短信也排除掉 +// { +// applicationInfos.add(app); +// } +// if(app.uid > 10000){//通过uid排除系统应用,在一些手机上效果不好 +// applicationInfos.add(app); +// } + if (allowPackages.contains(app.packageName) && !Arrays.asList(excludePackageName).contains(app.packageName)) { +// if (allowPackages.contains(app.packageName)) { + applicationInfos.add(app); + } + } + return applicationInfos; + } + + /** + * 获取第三方应用 + * @param context + * @return + */ + public static List queryFilterAppList(Context context) { + PackageManager pm = context.getPackageManager(); + // 查询所有已经安装的应用程序 + List appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除,但还有安装目录的 + List applicationInfos = new ArrayList<>(); + for (ApplicationInfo app : appInfos) { +// Log.e("queryFilterAppInfo", String.valueOf(app.flags)); +// Log.e("queryFilterAppInfo", String.valueOf((app.flags & mask))); + if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) { + //通过flag排除系统应用,会将电话、短信也排除掉 + } else { + applicationInfos.add(app.packageName); + Log.e("queryFilterAppInfo", app.packageName); + } + } + return applicationInfos; + } + + public static void openApp(Context context, String packageName) { + Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName); + if (intent != null) { + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } + } + + + public static Intent getAppOpenIntentByPackageName(Context context,String packageName){ + //Activity完整名 + String mainAct = null; + //根据包名寻找 + PackageManager pkgMag = context.getPackageManager(); + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_LAUNCHER); + intent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED|Intent.FLAG_ACTIVITY_NEW_TASK); + + List list = pkgMag.queryIntentActivities(intent, + PackageManager.GET_ACTIVITIES); + for (int i = 0; i < list.size(); i++) { + ResolveInfo info = list.get(i); + if (info.activityInfo.packageName.equals(packageName)) { + mainAct = info.activityInfo.name; + break; + } + } + if (TextUtils.isEmpty(mainAct)) { + return null; + } + intent.setComponent(new ComponentName(packageName, mainAct)); + return intent; + } + + public static Context getPackageContext(Context context, String packageName) { + Context pkgContext = null; + if (context.getPackageName().equals(packageName)) { + pkgContext = context; + } else { + // 创建第三方应用的上下文环境 + try { + pkgContext = context.createPackageContext(packageName, + Context.CONTEXT_IGNORE_SECURITY + | Context.CONTEXT_INCLUDE_CODE); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + } + return pkgContext; + } + + public static boolean openPackage(Context context, String packageName) { + Context pkgContext = getPackageContext(context, packageName); + Intent intent = getAppOpenIntentByPackageName(context, packageName); + if (pkgContext != null && intent != null) { + pkgContext.startActivity(intent); + return true; + } + return false; + } + +} diff --git a/app/src/main/java/com/uiui/os/utils/AppUtil.java b/app/src/main/java/com/uiui/os/utils/AppUtil.java new file mode 100644 index 0000000..37bf8f0 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/AppUtil.java @@ -0,0 +1,91 @@ +/* + * 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.os.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/os/utils/BitmapUtils.java b/app/src/main/java/com/uiui/os/utils/BitmapUtils.java new file mode 100644 index 0000000..8c81422 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/BitmapUtils.java @@ -0,0 +1,72 @@ +package com.uiui.os.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 bitmap; + } else { + return ((BitmapDrawable) drawable).getBitmap(); + } + } catch (Exception e) { + return null; + } + } +} diff --git a/app/src/main/java/com/uiui/os/utils/IconUtils.java b/app/src/main/java/com/uiui/os/utils/IconUtils.java new file mode 100644 index 0000000..f13e414 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/IconUtils.java @@ -0,0 +1,61 @@ +package com.uiui.os.utils; + +import java.util.ArrayList; +import java.util.List; + +public class IconUtils { + public static List appClassNameList = new ArrayList() { + { + this.add("com.android.appstore");//应用市场 + this.add("com.android.browser");//浏览器 + this.add("com.android.calculator2");//计算器 + this.add("com.android.calendar");//日历 + this.add("com.android.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.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");//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");//电子邮件 + } + }; + public static List appIconList = new ArrayList() {{ + this.add("com_android_appstore"); + 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_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_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_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"); + }}; +} diff --git a/app/src/main/java/com/uiui/os/utils/Utils.java b/app/src/main/java/com/uiui/os/utils/Utils.java new file mode 100644 index 0000000..503c980 --- /dev/null +++ b/app/src/main/java/com/uiui/os/utils/Utils.java @@ -0,0 +1,26 @@ +package com.uiui.os.utils; + +import android.content.Context; +import android.content.ContextWrapper; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.BatteryManager; +import android.os.Build; + +public class Utils { + /** + * 获取电量 + * + * @param mContext + * @return + */ + synchronized public static int getBatteryLevel(Context mContext) { + if (Build.VERSION.SDK_INT >= 21) { + return ((BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE)).getIntProperty(4); + } else { + Intent intent = (new ContextWrapper(mContext)).registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED")); + return intent.getIntExtra("level", -1) * 100 / intent.getIntExtra("scale", -1); + } + } + +} diff --git a/app/src/main/java/com/uiui/os/view/CustomContent.java b/app/src/main/java/com/uiui/os/view/CustomContent.java new file mode 100644 index 0000000..90ed334 --- /dev/null +++ b/app/src/main/java/com/uiui/os/view/CustomContent.java @@ -0,0 +1,71 @@ +package com.uiui.os.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.view.View; +import android.widget.FrameLayout; + +import androidx.annotation.AttrRes; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + + +public class CustomContent extends FrameLayout implements CustomContentCallbacks { + + public CustomContent(@NonNull Context context) { + super(context); + init(context); + } + + public CustomContent(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public CustomContent(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context){ + + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + } + + @Override + public void onShow(boolean fromResume) { + + } + + @Override + public void onHide() { + + } + + @Override + public void onScrollProgressChanged(float progress) { + + } + + // 滑到负一屏是否再允许滑动,true:允许滑动到主屏,false:不允许再滑动 + @Override + public boolean isScrollingAllowed() { + return false; + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + return super.onTouchEvent(event); + } + + @Override + public void onViewAdded(View child) { + super.onViewAdded(child); + + } +} diff --git a/app/src/main/java/com/uiui/os/view/CustomContentCallbacks.java b/app/src/main/java/com/uiui/os/view/CustomContentCallbacks.java new file mode 100644 index 0000000..86778d5 --- /dev/null +++ b/app/src/main/java/com/uiui/os/view/CustomContentCallbacks.java @@ -0,0 +1,21 @@ +package com.uiui.os.view; + + +// add by codemx.cn ---- 20190712 ---plus- start +// modify by codemx.cn ---- 20190712 ---plus- start +public interface CustomContentCallbacks { + + // Custom content is completely shown. {@code fromResume} indicates whether this was caused + // by a onResume or by scrolling otherwise. + void onShow(boolean fromResume); + + // Custom content is completely hidden + void onHide(); + + // Custom content scroll progress changed. From 0 (not showing) to 1 (fully showing). + void onScrollProgressChanged(float progress); + + // Indicates whether the user is allowed to scroll away from the custom content. + boolean isScrollingAllowed(); + +} diff --git a/app/src/main/java/com/uiui/os/view/MyGridLayout.java b/app/src/main/java/com/uiui/os/view/MyGridLayout.java new file mode 100644 index 0000000..a05fa73 --- /dev/null +++ b/app/src/main/java/com/uiui/os/view/MyGridLayout.java @@ -0,0 +1,176 @@ +package com.uiui.os.view; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.util.Log; +import android.view.View; +import android.view.ViewGroup; + + +import com.uiui.os.R; + +import java.util.ArrayList; + +import static android.view.View.MeasureSpec.EXACTLY; +import static android.view.View.MeasureSpec.makeMeasureSpec; + +/** + * 自定义布局组件 + * + * @author zihao + */ +public class MyGridLayout extends ViewGroup { + int margin = 2;// 每个格子的水平和垂直间隔 + int colums = 4;//列数 + int rows = 3;//行数 + int count = 0; + + private GridAdatper adapter; + private String TAG = MyGridLayout.class.getSimpleName(); + + @SuppressLint("Recycle") + public MyGridLayout(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + if (attrs != null) { + TypedArray a = getContext().obtainStyledAttributes(attrs, + R.styleable.MyGridLayout); + margin = a.getInteger(R.styleable.MyGridLayout_itemMargin, 2); + colums = a.getInteger(R.styleable.MyGridLayout_numColumns, 4); + rows = a.getInteger(R.styleable.MyGridLayout_numRows, 3); + } + } + + public MyGridLayout(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public MyGridLayout(Context context) { + this(context, null); + } + + public void setColums(int c) { + this.colums = c; + } + + public void setRows(int r) { + this.rows = r; + } + + public void set(int c, int r) { + this.colums = c; + this.rows = r; + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + count = getChildCount(); + if (count == 0) { + super.onMeasure(widthMeasureSpec, widthMeasureSpec); + return; + } + + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + if (child.getVisibility() == GONE) { + continue; + } + child.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED); + } + + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + int height = b - t;// 布局区域高度 + int width = r - l;// 布局区域宽度 +// int rows = count % colums == 0 ? count / colums : count / colums + 1;// 行数 + if (count == 0) + return; + int gridW = (width - margin * (colums + 1)) / colums;// 格子宽度 + int gridH = (height - margin * (rows + 1)) / rows;// 格子高度 + + int left; + int top = margin + margin / 2; + + for (int i = 0; i < rows; i++) {// 遍历行 + for (int j = 0; j < colums; j++) {// 遍历每一行的元素 + View child = this.getChildAt(i * colums + j); + if (child == null) + return; +// if (j == 0) { + left = j * gridW + (j + 1) * margin + margin / 2; +// } else { +// left = j * gridW + (j + 1) * margin; +// } + // 如果当前布局宽度和测量宽度不一样,就直接用当前布局的宽度重新测量 + if (gridW != child.getMeasuredWidth() + || gridH != child.getMeasuredHeight()) { + child.measure(makeMeasureSpec(gridW, EXACTLY), + makeMeasureSpec(gridH, EXACTLY)); + } + child.layout(left, top, left + gridW, top + gridH); +// Log.e(TAG, "onLayout: left = " + left); +// Log.e(TAG, "onLayout: top = " + top); +// Log.e(TAG, "onLayout: right = " + left + gridW); +// Log.e(TAG, "onLayout: bottom = " + top + gridH); + } + top += gridH + margin; + } + } + + public interface GridAdatper { + View getView(int index); + + int getCount(); + } + + /** + * 设置适配器 + */ + public void setGridAdapter(GridAdatper adapter) { + this.adapter = adapter; + // 动态添加视图 + int size = adapter.getCount(); + for (int i = 0; i < size; i++) { + addView(adapter.getView(i)); + } + } + + public interface OnItemClickListener { + void onItemClick(View v, int index); + } + + private ArrayList applicationInfos; + + public void setApplicationInfos(ArrayList infoArrayList) { + this.applicationInfos = infoArrayList; + } + + /** + * 设置item点击事件 + * + * @param click + */ + public void setOnItemClickListener(final OnItemClickListener click) { + if (this.adapter == null) + return; + for (int i = 0; i < adapter.getCount(); i++) { + final int index = i; + View view = getChildAt(i); + view.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + click.onItemClick(v, index); + } + }); + if (applicationInfos.get(index) == null) { + view.setClickable(false); + } else view.setClickable(true); + } + } +} diff --git a/app/src/main/java/com/uiui/os/view/ScaleCircleNavigator.java b/app/src/main/java/com/uiui/os/view/ScaleCircleNavigator.java new file mode 100644 index 0000000..f810d5d --- /dev/null +++ b/app/src/main/java/com/uiui/os/view/ScaleCircleNavigator.java @@ -0,0 +1,323 @@ +package com.uiui.os.view; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.PointF; +import android.util.SparseArray; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewConfiguration; +import android.view.animation.Interpolator; +import android.view.animation.LinearInterpolator; + +import net.lucode.hackware.magicindicator.NavigatorHelper; +import net.lucode.hackware.magicindicator.abs.IPagerNavigator; +import net.lucode.hackware.magicindicator.buildins.ArgbEvaluatorHolder; +import net.lucode.hackware.magicindicator.buildins.UIUtil; + +import java.util.ArrayList; +import java.util.List; + +// _oo0oo_ +// o8888888o +// 88" . "88 +// (| -_- |) +// 0\ = /0 +// ___/`---'\___ +// .' \\| |// '. +// / \\||| : |||// \ +// / _||||| -:- |||||- \ +// | | \\\ - /// | | +// | \_| ''\---/'' |_/ | +// \ .-\__ '-' ___/-. / +// ___'. .' /--.--\ `. .'___ +// ."" '< `.___\_<|>_/___.' >' "". +// | | : `- \`.;`\ _ /`;.`/ - ` : | | +// \ \ `_. \_ __\ /__ _/ .-` / / +// =====`-.____`.___ \_____/___.-`___.-'===== +// `=---=' +// +// +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// 佛祖保佑 永无BUG + +/** + * 类似CircleIndicator的效果 + * Created by hackware on 2016/9/3. + */ + +public class ScaleCircleNavigator extends View implements IPagerNavigator, NavigatorHelper.OnNavigatorScrollListener { + private int mMinRadius; + private int mMaxRadius; + private int mNormalCircleColor = Color.LTGRAY; + private int mSelectedCircleColor = Color.GRAY; + private int mCircleSpacing; + private int mCircleCount; + + private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + private List mCirclePoints = new ArrayList(); + private SparseArray mCircleRadiusArray = new SparseArray(); + + // 事件回调 + private boolean mTouchable; + private ScaleCircleNavigator.OnCircleClickListener mCircleClickListener; + private float mDownX; + private float mDownY; + private int mTouchSlop; + + private boolean mFollowTouch = true; // 是否跟随手指滑动 + private NavigatorHelper mNavigatorHelper = new NavigatorHelper(); + private Interpolator mStartInterpolator = new LinearInterpolator(); + + public ScaleCircleNavigator(Context context) { + super(context); + init(context); + } + + private void init(Context context) { + mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); + mMinRadius = UIUtil.dip2px(context, 3); + mMaxRadius = UIUtil.dip2px(context, 4); + mCircleSpacing = UIUtil.dip2px(context, 8); + mNavigatorHelper.setNavigatorScrollListener(this); + mNavigatorHelper.setSkimOver(true); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec)); + } + + private int measureWidth(int widthMeasureSpec) { + int mode = MeasureSpec.getMode(widthMeasureSpec); + int width = MeasureSpec.getSize(widthMeasureSpec); + int result = 0; + switch (mode) { + case MeasureSpec.EXACTLY: + result = width; + break; + case MeasureSpec.AT_MOST: + case MeasureSpec.UNSPECIFIED: + if (mCircleCount <= 0) { + result = getPaddingLeft() + getPaddingRight(); + } else { + result = (mCircleCount - 1) * mMinRadius * 2 + mMaxRadius * 2 + (mCircleCount - 1) * mCircleSpacing + getPaddingLeft() + getPaddingRight(); + } + break; + default: + break; + } + return result; + } + + private int measureHeight(int heightMeasureSpec) { + int mode = MeasureSpec.getMode(heightMeasureSpec); + int height = MeasureSpec.getSize(heightMeasureSpec); + int result = 0; + switch (mode) { + case MeasureSpec.EXACTLY: + result = height; + break; + case MeasureSpec.AT_MOST: + case MeasureSpec.UNSPECIFIED: + result = mMaxRadius * 2 + getPaddingTop() + getPaddingBottom(); + break; + default: + break; + } + return result; + } + + @Override + protected void onDraw(Canvas canvas) { + for (int i = 0, j = mCirclePoints.size(); i < j; i++) { + PointF point = mCirclePoints.get(i); + float radius = mCircleRadiusArray.get(i, (float) mMinRadius); + mPaint.setColor(ArgbEvaluatorHolder.eval((radius - mMinRadius) / (mMaxRadius - mMinRadius), mNormalCircleColor, mSelectedCircleColor)); + canvas.drawCircle(point.x, getHeight() / 2.0f, radius, mPaint); + } + } + + private void prepareCirclePoints() { + mCirclePoints.clear(); + if (mCircleCount > 0) { + int y = Math.round(getHeight() / 2.0f); + int centerSpacing = mMinRadius * 2 + mCircleSpacing; + int startX = mMaxRadius + getPaddingLeft(); + for (int i = 0; i < mCircleCount; i++) { + PointF pointF = new PointF(startX, y); + mCirclePoints.add(pointF); + startX += centerSpacing; + } + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + float x = event.getX(); + float y = event.getY(); + switch (event.getAction()) { + case MotionEvent.ACTION_DOWN: + if (mTouchable) { + mDownX = x; + mDownY = y; + return true; + } + break; + case MotionEvent.ACTION_UP: + if (mCircleClickListener != null) { + if (Math.abs(x - mDownX) <= mTouchSlop && Math.abs(y - mDownY) <= mTouchSlop) { + float max = Float.MAX_VALUE; + int index = 0; + for (int i = 0; i < mCirclePoints.size(); i++) { + PointF pointF = mCirclePoints.get(i); + float offset = Math.abs(pointF.x - x); + if (offset < max) { + max = offset; + index = i; + } + } + mCircleClickListener.onClick(index); + } + } + break; + default: + break; + } + return super.onTouchEvent(event); + } + + @Override + public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { + mNavigatorHelper.onPageScrolled(position, positionOffset, positionOffsetPixels); + } + + @Override + public void onPageSelected(int position) { + mNavigatorHelper.onPageSelected(position); + } + + @Override + public void onPageScrollStateChanged(int state) { + mNavigatorHelper.onPageScrollStateChanged(state); + } + + @Override + protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + prepareCirclePoints(); + } + + @Override + public void notifyDataSetChanged() { + prepareCirclePoints(); + requestLayout(); + } + + @Override + public void onAttachToMagicIndicator() { + } + + @Override + public void onDetachFromMagicIndicator() { + } + + public void setMinRadius(int minRadius) { + mMinRadius = minRadius; + prepareCirclePoints(); + invalidate(); + } + + public void setMaxRadius(int maxRadius) { + mMaxRadius = maxRadius; + prepareCirclePoints(); + invalidate(); + } + + public void setNormalCircleColor(int normalCircleColor) { + mNormalCircleColor = normalCircleColor; + invalidate(); + } + + public void setSelectedCircleColor(int selectedCircleColor) { + mSelectedCircleColor = selectedCircleColor; + invalidate(); + } + + public void setCircleSpacing(int circleSpacing) { + mCircleSpacing = circleSpacing; + prepareCirclePoints(); + invalidate(); + } + + public void setStartInterpolator(Interpolator startInterpolator) { + mStartInterpolator = startInterpolator; + if (mStartInterpolator == null) { + mStartInterpolator = new LinearInterpolator(); + } + } + + public void setCircleCount(int count) { + mCircleCount = count; // 此处不调用invalidate,让外部调用notifyDataSetChanged + mNavigatorHelper.setTotalCount(mCircleCount); + } + + public void setTouchable(boolean touchable) { + mTouchable = touchable; + } + + public void setFollowTouch(boolean followTouch) { + mFollowTouch = followTouch; + } + + public void setSkimOver(boolean skimOver) { + mNavigatorHelper.setSkimOver(skimOver); + } + + public void setCircleClickListener(OnCircleClickListener circleClickListener) { + if (!mTouchable) { + mTouchable = true; + } + mCircleClickListener = circleClickListener; + } + + @Override + public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) { + if (mFollowTouch) { + float radius = mMinRadius + (mMaxRadius - mMinRadius) * mStartInterpolator.getInterpolation(enterPercent); + mCircleRadiusArray.put(index, radius); + invalidate(); + } + } + + @Override + public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) { + if (mFollowTouch) { + float radius = mMaxRadius + (mMinRadius - mMaxRadius) * mStartInterpolator.getInterpolation(leavePercent); + mCircleRadiusArray.put(index, radius); + invalidate(); + } + } + + @Override + public void onSelected(int index, int totalCount) { + if (!mFollowTouch) { + mCircleRadiusArray.put(index, (float) mMaxRadius); + invalidate(); + } + } + + @Override + public void onDeselected(int index, int totalCount) { + if (!mFollowTouch) { + mCircleRadiusArray.put(index, (float) mMinRadius); + invalidate(); + } + } + + public interface OnCircleClickListener { + void onClick(int index); + } +} diff --git a/app/src/main/res/drawable-hdpi/actions_about.png b/app/src/main/res/drawable-hdpi/actions_about.png new file mode 100644 index 0000000..bf8fb68 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_about.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_account.png b/app/src/main/res/drawable-hdpi/actions_account.png new file mode 100644 index 0000000..83f3f49 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_account.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_booktag.png b/app/src/main/res/drawable-hdpi/actions_booktag.png new file mode 100644 index 0000000..538c60d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_booktag.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_cent.png b/app/src/main/res/drawable-hdpi/actions_cent.png new file mode 100644 index 0000000..02b6df9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_cent.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_comment.png b/app/src/main/res/drawable-hdpi/actions_comment.png new file mode 100644 index 0000000..22246f2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_comment.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_feedback.png b/app/src/main/res/drawable-hdpi/actions_feedback.png new file mode 100644 index 0000000..f47cfa1 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_feedback.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_item_bg_s.9.png b/app/src/main/res/drawable-hdpi/actions_item_bg_s.9.png new file mode 100644 index 0000000..c2f3606 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_item_bg_s.9.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_logo.png b/app/src/main/res/drawable-hdpi/actions_logo.png new file mode 100644 index 0000000..dbbdff2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_logo.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_order.png b/app/src/main/res/drawable-hdpi/actions_order.png new file mode 100644 index 0000000..065ec3d Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_order.png differ diff --git a/app/src/main/res/drawable-hdpi/actions_weibo.png b/app/src/main/res/drawable-hdpi/actions_weibo.png new file mode 100644 index 0000000..402d9b7 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/actions_weibo.png differ diff --git a/app/src/main/res/drawable-hdpi/charging.png b/app/src/main/res/drawable-hdpi/charging.png new file mode 100644 index 0000000..e888fe8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/charging.png 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 new file mode 100644 index 0000000..30862b0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_appstore.png 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 new file mode 100644 index 0000000..892b435 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_browser.png 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 new file mode 100644 index 0000000..761fc13 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_calculator2.png 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 new file mode 100644 index 0000000..93ef0a6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_calendar.png 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 new file mode 100644 index 0000000..86e6155 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_camera.png 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 new file mode 100644 index 0000000..7baf8a2 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_clean.png 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 new file mode 100644 index 0000000..686a553 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_contacts.png 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 new file mode 100644 index 0000000..ba985e6 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_deskclock.png 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 new file mode 100644 index 0000000..7083624 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_dialer.png 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 new file mode 100644 index 0000000..6c2fcf5 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_email.png 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 new file mode 100644 index 0000000..2704c93 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_gallery3d_app.png 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 new file mode 100644 index 0000000..aea3f99 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_mms_ui.png 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 new file mode 100644 index 0000000..afaa1cc Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_music.png 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 new file mode 100644 index 0000000..3e7daad Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_providers_downloads_ui.png 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 new file mode 100644 index 0000000..fed06bb Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_quicksearchbox.png 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 new file mode 100644 index 0000000..c683b06 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_settings.png 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 new file mode 100644 index 0000000..4d10a8c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_soundrecorder.png 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 new file mode 100644 index 0000000..6529029 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_stk_stkmain.png 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 new file mode 100644 index 0000000..22e10cc Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_android_vdieo.png 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 new file mode 100644 index 0000000..a68cc03 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_mediatek_filemanager.png 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 new file mode 100644 index 0000000..4bf4867 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/com_mediatek_fmradio.png differ diff --git a/app/src/main/res/drawable-hdpi/scan_qrcode.png b/app/src/main/res/drawable-hdpi/scan_qrcode.png new file mode 100644 index 0000000..1ee8ab0 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/scan_qrcode.png differ diff --git a/app/src/main/res/drawable-xhdpi/he100.png b/app/src/main/res/drawable-xhdpi/he100.png new file mode 100644 index 0000000..e06d8fd Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he100.png differ diff --git a/app/src/main/res/drawable-xhdpi/he101.png b/app/src/main/res/drawable-xhdpi/he101.png new file mode 100644 index 0000000..0847a52 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he101.png differ diff --git a/app/src/main/res/drawable-xhdpi/he102.png b/app/src/main/res/drawable-xhdpi/he102.png new file mode 100644 index 0000000..740ea6b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he102.png differ diff --git a/app/src/main/res/drawable-xhdpi/he103.png b/app/src/main/res/drawable-xhdpi/he103.png new file mode 100644 index 0000000..ca194d6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he103.png differ diff --git a/app/src/main/res/drawable-xhdpi/he104.png b/app/src/main/res/drawable-xhdpi/he104.png new file mode 100644 index 0000000..2adca0e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he104.png differ diff --git a/app/src/main/res/drawable-xhdpi/he150.png b/app/src/main/res/drawable-xhdpi/he150.png new file mode 100644 index 0000000..5d93e20 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he150.png differ diff --git a/app/src/main/res/drawable-xhdpi/he153.png b/app/src/main/res/drawable-xhdpi/he153.png new file mode 100644 index 0000000..33bffb1 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he153.png differ diff --git a/app/src/main/res/drawable-xhdpi/he154.png b/app/src/main/res/drawable-xhdpi/he154.png new file mode 100644 index 0000000..96a296d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he154.png differ diff --git a/app/src/main/res/drawable-xhdpi/he300.png b/app/src/main/res/drawable-xhdpi/he300.png new file mode 100644 index 0000000..8543e30 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he300.png differ diff --git a/app/src/main/res/drawable-xhdpi/he301.png b/app/src/main/res/drawable-xhdpi/he301.png new file mode 100644 index 0000000..47fc1eb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he301.png differ diff --git a/app/src/main/res/drawable-xhdpi/he302.png b/app/src/main/res/drawable-xhdpi/he302.png new file mode 100644 index 0000000..83f312b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he302.png differ diff --git a/app/src/main/res/drawable-xhdpi/he303.png b/app/src/main/res/drawable-xhdpi/he303.png new file mode 100644 index 0000000..88bcb84 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he303.png differ diff --git a/app/src/main/res/drawable-xhdpi/he304.png b/app/src/main/res/drawable-xhdpi/he304.png new file mode 100644 index 0000000..6c63872 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he304.png differ diff --git a/app/src/main/res/drawable-xhdpi/he305.png b/app/src/main/res/drawable-xhdpi/he305.png new file mode 100644 index 0000000..f8a16f9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he305.png differ diff --git a/app/src/main/res/drawable-xhdpi/he306.png b/app/src/main/res/drawable-xhdpi/he306.png new file mode 100644 index 0000000..deeadf6 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he306.png differ diff --git a/app/src/main/res/drawable-xhdpi/he307.png b/app/src/main/res/drawable-xhdpi/he307.png new file mode 100644 index 0000000..a6b9cd0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he307.png differ diff --git a/app/src/main/res/drawable-xhdpi/he308.png b/app/src/main/res/drawable-xhdpi/he308.png new file mode 100644 index 0000000..3cf2267 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he308.png differ diff --git a/app/src/main/res/drawable-xhdpi/he309.png b/app/src/main/res/drawable-xhdpi/he309.png new file mode 100644 index 0000000..31fdba1 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he309.png differ diff --git a/app/src/main/res/drawable-xhdpi/he310.png b/app/src/main/res/drawable-xhdpi/he310.png new file mode 100644 index 0000000..991ee2b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he310.png differ diff --git a/app/src/main/res/drawable-xhdpi/he311.png b/app/src/main/res/drawable-xhdpi/he311.png new file mode 100644 index 0000000..e237dd2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he311.png differ diff --git a/app/src/main/res/drawable-xhdpi/he312.png b/app/src/main/res/drawable-xhdpi/he312.png new file mode 100644 index 0000000..73b5843 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he312.png differ diff --git a/app/src/main/res/drawable-xhdpi/he313.png b/app/src/main/res/drawable-xhdpi/he313.png new file mode 100644 index 0000000..7f39836 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he313.png differ diff --git a/app/src/main/res/drawable-xhdpi/he314.png b/app/src/main/res/drawable-xhdpi/he314.png new file mode 100644 index 0000000..007667f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he314.png differ diff --git a/app/src/main/res/drawable-xhdpi/he315.png b/app/src/main/res/drawable-xhdpi/he315.png new file mode 100644 index 0000000..bdc90fa Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he315.png differ diff --git a/app/src/main/res/drawable-xhdpi/he316.png b/app/src/main/res/drawable-xhdpi/he316.png new file mode 100644 index 0000000..a758db3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he316.png differ diff --git a/app/src/main/res/drawable-xhdpi/he317.png b/app/src/main/res/drawable-xhdpi/he317.png new file mode 100644 index 0000000..dd6fdba Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he317.png differ diff --git a/app/src/main/res/drawable-xhdpi/he318.png b/app/src/main/res/drawable-xhdpi/he318.png new file mode 100644 index 0000000..66e81da Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he318.png differ diff --git a/app/src/main/res/drawable-xhdpi/he350.png b/app/src/main/res/drawable-xhdpi/he350.png new file mode 100644 index 0000000..bb9ec1d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he350.png differ diff --git a/app/src/main/res/drawable-xhdpi/he351.png b/app/src/main/res/drawable-xhdpi/he351.png new file mode 100644 index 0000000..22cf94d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he351.png differ diff --git a/app/src/main/res/drawable-xhdpi/he399.png b/app/src/main/res/drawable-xhdpi/he399.png new file mode 100644 index 0000000..c9f69ed Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he399.png differ diff --git a/app/src/main/res/drawable-xhdpi/he400.png b/app/src/main/res/drawable-xhdpi/he400.png new file mode 100644 index 0000000..7c394d0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he400.png differ diff --git a/app/src/main/res/drawable-xhdpi/he401.png b/app/src/main/res/drawable-xhdpi/he401.png new file mode 100644 index 0000000..cc515c8 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he401.png differ diff --git a/app/src/main/res/drawable-xhdpi/he402.png b/app/src/main/res/drawable-xhdpi/he402.png new file mode 100644 index 0000000..18a3dc7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he402.png differ diff --git a/app/src/main/res/drawable-xhdpi/he403.png b/app/src/main/res/drawable-xhdpi/he403.png new file mode 100644 index 0000000..3649ce7 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he403.png differ diff --git a/app/src/main/res/drawable-xhdpi/he404.png b/app/src/main/res/drawable-xhdpi/he404.png new file mode 100644 index 0000000..77e373c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he404.png differ diff --git a/app/src/main/res/drawable-xhdpi/he405.png b/app/src/main/res/drawable-xhdpi/he405.png new file mode 100644 index 0000000..9ed83e3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he405.png differ diff --git a/app/src/main/res/drawable-xhdpi/he406.png b/app/src/main/res/drawable-xhdpi/he406.png new file mode 100644 index 0000000..0ca43f1 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he406.png differ diff --git a/app/src/main/res/drawable-xhdpi/he407.png b/app/src/main/res/drawable-xhdpi/he407.png new file mode 100644 index 0000000..b59208d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he407.png differ diff --git a/app/src/main/res/drawable-xhdpi/he408.png b/app/src/main/res/drawable-xhdpi/he408.png new file mode 100644 index 0000000..d8253a4 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he408.png differ diff --git a/app/src/main/res/drawable-xhdpi/he409.png b/app/src/main/res/drawable-xhdpi/he409.png new file mode 100644 index 0000000..c8aca0c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he409.png differ diff --git a/app/src/main/res/drawable-xhdpi/he410.png b/app/src/main/res/drawable-xhdpi/he410.png new file mode 100644 index 0000000..f5cb3a3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he410.png differ diff --git a/app/src/main/res/drawable-xhdpi/he456.png b/app/src/main/res/drawable-xhdpi/he456.png new file mode 100644 index 0000000..83564f9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he456.png differ diff --git a/app/src/main/res/drawable-xhdpi/he457.png b/app/src/main/res/drawable-xhdpi/he457.png new file mode 100644 index 0000000..d3fde4e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he457.png differ diff --git a/app/src/main/res/drawable-xhdpi/he499.png b/app/src/main/res/drawable-xhdpi/he499.png new file mode 100644 index 0000000..66863b9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he499.png differ diff --git a/app/src/main/res/drawable-xhdpi/he500.png b/app/src/main/res/drawable-xhdpi/he500.png new file mode 100644 index 0000000..2d9e467 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he500.png differ diff --git a/app/src/main/res/drawable-xhdpi/he501.png b/app/src/main/res/drawable-xhdpi/he501.png new file mode 100644 index 0000000..41e9cbe Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he501.png differ diff --git a/app/src/main/res/drawable-xhdpi/he502.png b/app/src/main/res/drawable-xhdpi/he502.png new file mode 100644 index 0000000..48af382 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he502.png differ diff --git a/app/src/main/res/drawable-xhdpi/he503.png b/app/src/main/res/drawable-xhdpi/he503.png new file mode 100644 index 0000000..9a5556f Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he503.png differ diff --git a/app/src/main/res/drawable-xhdpi/he504.png b/app/src/main/res/drawable-xhdpi/he504.png new file mode 100644 index 0000000..f6fa6c0 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he504.png differ diff --git a/app/src/main/res/drawable-xhdpi/he507.png b/app/src/main/res/drawable-xhdpi/he507.png new file mode 100644 index 0000000..2e8a073 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he507.png differ diff --git a/app/src/main/res/drawable-xhdpi/he508.png b/app/src/main/res/drawable-xhdpi/he508.png new file mode 100644 index 0000000..6e5a041 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he508.png differ diff --git a/app/src/main/res/drawable-xhdpi/he509.png b/app/src/main/res/drawable-xhdpi/he509.png new file mode 100644 index 0000000..1e493b9 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he509.png differ diff --git a/app/src/main/res/drawable-xhdpi/he510.png b/app/src/main/res/drawable-xhdpi/he510.png new file mode 100644 index 0000000..110fd8d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he510.png differ diff --git a/app/src/main/res/drawable-xhdpi/he511.png b/app/src/main/res/drawable-xhdpi/he511.png new file mode 100644 index 0000000..886f100 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he511.png differ diff --git a/app/src/main/res/drawable-xhdpi/he512.png b/app/src/main/res/drawable-xhdpi/he512.png new file mode 100644 index 0000000..71cf968 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he512.png differ diff --git a/app/src/main/res/drawable-xhdpi/he513.png b/app/src/main/res/drawable-xhdpi/he513.png new file mode 100644 index 0000000..b75b24d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he513.png differ diff --git a/app/src/main/res/drawable-xhdpi/he514.png b/app/src/main/res/drawable-xhdpi/he514.png new file mode 100644 index 0000000..a819d46 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he514.png differ diff --git a/app/src/main/res/drawable-xhdpi/he515.png b/app/src/main/res/drawable-xhdpi/he515.png new file mode 100644 index 0000000..43c02db Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he515.png differ diff --git a/app/src/main/res/drawable-xhdpi/he900.png b/app/src/main/res/drawable-xhdpi/he900.png new file mode 100644 index 0000000..c432982 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he900.png differ diff --git a/app/src/main/res/drawable-xhdpi/he901.png b/app/src/main/res/drawable-xhdpi/he901.png new file mode 100644 index 0000000..8a2f456 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he901.png differ diff --git a/app/src/main/res/drawable-xhdpi/he999.png b/app/src/main/res/drawable-xhdpi/he999.png new file mode 100644 index 0000000..c167cbb Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/he999.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_uninstall.png b/app/src/main/res/drawable-xhdpi/ic_uninstall.png new file mode 100644 index 0000000..e2d34df Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_uninstall.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_widget_resize_handle.png b/app/src/main/res/drawable-xhdpi/ic_widget_resize_handle.png new file mode 100644 index 0000000..0e8dd68 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_widget_resize_handle.png differ diff --git a/app/src/main/res/drawable-xhdpi/widget_resize_frame.9.png b/app/src/main/res/drawable-xhdpi/widget_resize_frame.9.png new file mode 100644 index 0000000..563c75d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/widget_resize_frame.9.png differ diff --git a/app/src/main/res/drawable-xhdpi/widget_resize_shadow.9.png b/app/src/main/res/drawable-xhdpi/widget_resize_shadow.9.png new file mode 100644 index 0000000..2b1ac05 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/widget_resize_shadow.9.png differ diff --git a/app/src/main/res/drawable-xhdpi/work_tab_user_education.png b/app/src/main/res/drawable-xhdpi/work_tab_user_education.png new file mode 100644 index 0000000..59df7a8 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/work_tab_user_education.png differ diff --git a/app/src/main/res/drawable-xhdpi/workspace_bg.9.png b/app/src/main/res/drawable-xhdpi/workspace_bg.9.png new file mode 100644 index 0000000..b1b3b85 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/workspace_bg.9.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he100.png b/app/src/main/res/drawable-xxhdpi/he100.png new file mode 100644 index 0000000..6669841 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he100.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he101.png b/app/src/main/res/drawable-xxhdpi/he101.png new file mode 100644 index 0000000..2f74dcf Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he101.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he102.png b/app/src/main/res/drawable-xxhdpi/he102.png new file mode 100644 index 0000000..784b078 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he102.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he103.png b/app/src/main/res/drawable-xxhdpi/he103.png new file mode 100644 index 0000000..8767acb Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he103.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he104.png b/app/src/main/res/drawable-xxhdpi/he104.png new file mode 100644 index 0000000..6420624 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he104.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he150.png b/app/src/main/res/drawable-xxhdpi/he150.png new file mode 100644 index 0000000..df55ec5 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he150.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he153.png b/app/src/main/res/drawable-xxhdpi/he153.png new file mode 100644 index 0000000..f018af0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he153.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he154.png b/app/src/main/res/drawable-xxhdpi/he154.png new file mode 100644 index 0000000..22f42c0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he154.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he300.png b/app/src/main/res/drawable-xxhdpi/he300.png new file mode 100644 index 0000000..1de84ba Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he300.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he301.png b/app/src/main/res/drawable-xxhdpi/he301.png new file mode 100644 index 0000000..0fc3b9d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he301.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he302.png b/app/src/main/res/drawable-xxhdpi/he302.png new file mode 100644 index 0000000..61c4406 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he302.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he303.png b/app/src/main/res/drawable-xxhdpi/he303.png new file mode 100644 index 0000000..6a8b3c4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he303.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he304.png b/app/src/main/res/drawable-xxhdpi/he304.png new file mode 100644 index 0000000..19a2556 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he304.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he305.png b/app/src/main/res/drawable-xxhdpi/he305.png new file mode 100644 index 0000000..1105af0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he305.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he306.png b/app/src/main/res/drawable-xxhdpi/he306.png new file mode 100644 index 0000000..b307070 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he306.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he307.png b/app/src/main/res/drawable-xxhdpi/he307.png new file mode 100644 index 0000000..810a23a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he307.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he308.png b/app/src/main/res/drawable-xxhdpi/he308.png new file mode 100644 index 0000000..9600919 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he308.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he309.png b/app/src/main/res/drawable-xxhdpi/he309.png new file mode 100644 index 0000000..9c805d8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he309.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he310.png b/app/src/main/res/drawable-xxhdpi/he310.png new file mode 100644 index 0000000..9608b6e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he310.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he311.png b/app/src/main/res/drawable-xxhdpi/he311.png new file mode 100644 index 0000000..59c74ed Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he311.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he312.png b/app/src/main/res/drawable-xxhdpi/he312.png new file mode 100644 index 0000000..1daa1da Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he312.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he313.png b/app/src/main/res/drawable-xxhdpi/he313.png new file mode 100644 index 0000000..11ca685 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he313.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he314.png b/app/src/main/res/drawable-xxhdpi/he314.png new file mode 100644 index 0000000..3b6ac91 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he314.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he315.png b/app/src/main/res/drawable-xxhdpi/he315.png new file mode 100644 index 0000000..8f06fae Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he315.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he316.png b/app/src/main/res/drawable-xxhdpi/he316.png new file mode 100644 index 0000000..b3395ac Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he316.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he317.png b/app/src/main/res/drawable-xxhdpi/he317.png new file mode 100644 index 0000000..8441d41 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he317.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he318.png b/app/src/main/res/drawable-xxhdpi/he318.png new file mode 100644 index 0000000..af60e09 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he318.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he350.png b/app/src/main/res/drawable-xxhdpi/he350.png new file mode 100644 index 0000000..3976006 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he350.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he351.png b/app/src/main/res/drawable-xxhdpi/he351.png new file mode 100644 index 0000000..b436ea4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he351.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he399.png b/app/src/main/res/drawable-xxhdpi/he399.png new file mode 100644 index 0000000..44a094c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he399.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he400.png b/app/src/main/res/drawable-xxhdpi/he400.png new file mode 100644 index 0000000..e512d55 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he400.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he401.png b/app/src/main/res/drawable-xxhdpi/he401.png new file mode 100644 index 0000000..4765e28 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he401.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he402.png b/app/src/main/res/drawable-xxhdpi/he402.png new file mode 100644 index 0000000..4fab297 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he402.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he403.png b/app/src/main/res/drawable-xxhdpi/he403.png new file mode 100644 index 0000000..77f12a6 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he403.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he404.png b/app/src/main/res/drawable-xxhdpi/he404.png new file mode 100644 index 0000000..a70a3d0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he404.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he405.png b/app/src/main/res/drawable-xxhdpi/he405.png new file mode 100644 index 0000000..697c726 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he405.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he406.png b/app/src/main/res/drawable-xxhdpi/he406.png new file mode 100644 index 0000000..38657ca Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he406.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he407.png b/app/src/main/res/drawable-xxhdpi/he407.png new file mode 100644 index 0000000..12647d2 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he407.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he408.png b/app/src/main/res/drawable-xxhdpi/he408.png new file mode 100644 index 0000000..5e11377 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he408.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he409.png b/app/src/main/res/drawable-xxhdpi/he409.png new file mode 100644 index 0000000..5794537 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he409.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he410.png b/app/src/main/res/drawable-xxhdpi/he410.png new file mode 100644 index 0000000..b2077a1 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he410.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he456.png b/app/src/main/res/drawable-xxhdpi/he456.png new file mode 100644 index 0000000..1664034 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he456.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he457.png b/app/src/main/res/drawable-xxhdpi/he457.png new file mode 100644 index 0000000..1f56270 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he457.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he499.png b/app/src/main/res/drawable-xxhdpi/he499.png new file mode 100644 index 0000000..bc2fbd4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he499.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he500.png b/app/src/main/res/drawable-xxhdpi/he500.png new file mode 100644 index 0000000..d2ec7d6 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he500.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he501.png b/app/src/main/res/drawable-xxhdpi/he501.png new file mode 100644 index 0000000..ef3bc16 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he501.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he502.png b/app/src/main/res/drawable-xxhdpi/he502.png new file mode 100644 index 0000000..e7816da Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he502.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he503.png b/app/src/main/res/drawable-xxhdpi/he503.png new file mode 100644 index 0000000..0e5b5d1 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he503.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he504.png b/app/src/main/res/drawable-xxhdpi/he504.png new file mode 100644 index 0000000..185b37d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he504.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he507.png b/app/src/main/res/drawable-xxhdpi/he507.png new file mode 100644 index 0000000..4a6403d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he507.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he508.png b/app/src/main/res/drawable-xxhdpi/he508.png new file mode 100644 index 0000000..a3a333f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he508.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he509.png b/app/src/main/res/drawable-xxhdpi/he509.png new file mode 100644 index 0000000..5900d5c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he509.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he510.png b/app/src/main/res/drawable-xxhdpi/he510.png new file mode 100644 index 0000000..fdf6422 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he510.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he511.png b/app/src/main/res/drawable-xxhdpi/he511.png new file mode 100644 index 0000000..40cfd0e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he511.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he512.png b/app/src/main/res/drawable-xxhdpi/he512.png new file mode 100644 index 0000000..22ab63a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he512.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he513.png b/app/src/main/res/drawable-xxhdpi/he513.png new file mode 100644 index 0000000..6e8c4e3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he513.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he514.png b/app/src/main/res/drawable-xxhdpi/he514.png new file mode 100644 index 0000000..5892ad0 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he514.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he515.png b/app/src/main/res/drawable-xxhdpi/he515.png new file mode 100644 index 0000000..518137a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he515.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he900.png b/app/src/main/res/drawable-xxhdpi/he900.png new file mode 100644 index 0000000..020b8e3 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he900.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he901.png b/app/src/main/res/drawable-xxhdpi/he901.png new file mode 100644 index 0000000..df59561 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he901.png differ diff --git a/app/src/main/res/drawable-xxhdpi/he999.png b/app/src/main/res/drawable-xxhdpi/he999.png new file mode 100644 index 0000000..bb0c9f9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/he999.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_widget_resize_handle.png b/app/src/main/res/drawable-xxhdpi/ic_widget_resize_handle.png new file mode 100644 index 0000000..736a157 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_widget_resize_handle.png differ diff --git a/app/src/main/res/drawable-xxhdpi/widget_resize_frame.9.png b/app/src/main/res/drawable-xxhdpi/widget_resize_frame.9.png new file mode 100644 index 0000000..ea527f4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/widget_resize_frame.9.png differ diff --git a/app/src/main/res/drawable-xxhdpi/widget_resize_shadow.9.png b/app/src/main/res/drawable-xxhdpi/widget_resize_shadow.9.png new file mode 100644 index 0000000..5412168 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/widget_resize_shadow.9.png differ diff --git a/app/src/main/res/drawable-xxhdpi/work_tab_user_education.png b/app/src/main/res/drawable-xxhdpi/work_tab_user_education.png new file mode 100644 index 0000000..3c6aa20 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/work_tab_user_education.png differ diff --git a/app/src/main/res/drawable-xxhdpi/workspace_bg.9.png b/app/src/main/res/drawable-xxhdpi/workspace_bg.9.png new file mode 100644 index 0000000..d47f6b2 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/workspace_bg.9.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he100.png b/app/src/main/res/drawable-xxxhdpi/he100.png new file mode 100644 index 0000000..faf04c8 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he100.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he101.png b/app/src/main/res/drawable-xxxhdpi/he101.png new file mode 100644 index 0000000..17841e4 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he101.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he102.png b/app/src/main/res/drawable-xxxhdpi/he102.png new file mode 100644 index 0000000..51bc5a8 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he102.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he103.png b/app/src/main/res/drawable-xxxhdpi/he103.png new file mode 100644 index 0000000..5fd9957 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he103.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he104.png b/app/src/main/res/drawable-xxxhdpi/he104.png new file mode 100644 index 0000000..9628fbd Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he104.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he150.png b/app/src/main/res/drawable-xxxhdpi/he150.png new file mode 100644 index 0000000..eaee769 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he150.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he153.png b/app/src/main/res/drawable-xxxhdpi/he153.png new file mode 100644 index 0000000..346a2c2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he153.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he154.png b/app/src/main/res/drawable-xxxhdpi/he154.png new file mode 100644 index 0000000..358be1a Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he154.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he300.png b/app/src/main/res/drawable-xxxhdpi/he300.png new file mode 100644 index 0000000..24ba9bc Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he300.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he301.png b/app/src/main/res/drawable-xxxhdpi/he301.png new file mode 100644 index 0000000..ad65de8 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he301.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he302.png b/app/src/main/res/drawable-xxxhdpi/he302.png new file mode 100644 index 0000000..4a018ee Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he302.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he303.png b/app/src/main/res/drawable-xxxhdpi/he303.png new file mode 100644 index 0000000..aa8d273 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he303.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he304.png b/app/src/main/res/drawable-xxxhdpi/he304.png new file mode 100644 index 0000000..3155a49 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he304.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he305.png b/app/src/main/res/drawable-xxxhdpi/he305.png new file mode 100644 index 0000000..f76f6e3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he305.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he306.png b/app/src/main/res/drawable-xxxhdpi/he306.png new file mode 100644 index 0000000..ffb6804 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he306.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he307.png b/app/src/main/res/drawable-xxxhdpi/he307.png new file mode 100644 index 0000000..1e33073 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he307.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he308.png b/app/src/main/res/drawable-xxxhdpi/he308.png new file mode 100644 index 0000000..2586187 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he308.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he309.png b/app/src/main/res/drawable-xxxhdpi/he309.png new file mode 100644 index 0000000..9beebe3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he309.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he310.png b/app/src/main/res/drawable-xxxhdpi/he310.png new file mode 100644 index 0000000..624b04e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he310.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he311.png b/app/src/main/res/drawable-xxxhdpi/he311.png new file mode 100644 index 0000000..5fcc3fc Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he311.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he312.png b/app/src/main/res/drawable-xxxhdpi/he312.png new file mode 100644 index 0000000..0e93ff7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he312.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he313.png b/app/src/main/res/drawable-xxxhdpi/he313.png new file mode 100644 index 0000000..ba783d6 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he313.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he314.png b/app/src/main/res/drawable-xxxhdpi/he314.png new file mode 100644 index 0000000..9e93846 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he314.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he315.png b/app/src/main/res/drawable-xxxhdpi/he315.png new file mode 100644 index 0000000..527e6fe Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he315.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he316.png b/app/src/main/res/drawable-xxxhdpi/he316.png new file mode 100644 index 0000000..8309afb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he316.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he317.png b/app/src/main/res/drawable-xxxhdpi/he317.png new file mode 100644 index 0000000..2e9a702 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he317.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he318.png b/app/src/main/res/drawable-xxxhdpi/he318.png new file mode 100644 index 0000000..b99b851 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he318.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he350.png b/app/src/main/res/drawable-xxxhdpi/he350.png new file mode 100644 index 0000000..a9a0c52 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he350.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he351.png b/app/src/main/res/drawable-xxxhdpi/he351.png new file mode 100644 index 0000000..f7bdda3 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he351.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he399.png b/app/src/main/res/drawable-xxxhdpi/he399.png new file mode 100644 index 0000000..321233b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he399.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he400.png b/app/src/main/res/drawable-xxxhdpi/he400.png new file mode 100644 index 0000000..532879b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he400.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he401.png b/app/src/main/res/drawable-xxxhdpi/he401.png new file mode 100644 index 0000000..4a92fc7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he401.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he402.png b/app/src/main/res/drawable-xxxhdpi/he402.png new file mode 100644 index 0000000..ccc2dab Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he402.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he403.png b/app/src/main/res/drawable-xxxhdpi/he403.png new file mode 100644 index 0000000..da32ebe Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he403.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he404.png b/app/src/main/res/drawable-xxxhdpi/he404.png new file mode 100644 index 0000000..99a3d9d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he404.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he405.png b/app/src/main/res/drawable-xxxhdpi/he405.png new file mode 100644 index 0000000..c3ac8d4 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he405.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he406.png b/app/src/main/res/drawable-xxxhdpi/he406.png new file mode 100644 index 0000000..01348b1 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he406.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he407.png b/app/src/main/res/drawable-xxxhdpi/he407.png new file mode 100644 index 0000000..37cdd78 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he407.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he408.png b/app/src/main/res/drawable-xxxhdpi/he408.png new file mode 100644 index 0000000..f8d216c Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he408.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he409.png b/app/src/main/res/drawable-xxxhdpi/he409.png new file mode 100644 index 0000000..e7e729b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he409.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he410.png b/app/src/main/res/drawable-xxxhdpi/he410.png new file mode 100644 index 0000000..3e4dcf2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he410.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he456.png b/app/src/main/res/drawable-xxxhdpi/he456.png new file mode 100644 index 0000000..1b080c7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he456.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he457.png b/app/src/main/res/drawable-xxxhdpi/he457.png new file mode 100644 index 0000000..1b610d2 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he457.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he499.png b/app/src/main/res/drawable-xxxhdpi/he499.png new file mode 100644 index 0000000..c486a59 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he499.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he500.png b/app/src/main/res/drawable-xxxhdpi/he500.png new file mode 100644 index 0000000..dcecc31 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he500.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he501.png b/app/src/main/res/drawable-xxxhdpi/he501.png new file mode 100644 index 0000000..41fba52 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he501.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he502.png b/app/src/main/res/drawable-xxxhdpi/he502.png new file mode 100644 index 0000000..6ffda43 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he502.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he503.png b/app/src/main/res/drawable-xxxhdpi/he503.png new file mode 100644 index 0000000..f7e2296 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he503.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he504.png b/app/src/main/res/drawable-xxxhdpi/he504.png new file mode 100644 index 0000000..b26ea7b Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he504.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he507.png b/app/src/main/res/drawable-xxxhdpi/he507.png new file mode 100644 index 0000000..43b1e6e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he507.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he508.png b/app/src/main/res/drawable-xxxhdpi/he508.png new file mode 100644 index 0000000..f932cd9 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he508.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he509.png b/app/src/main/res/drawable-xxxhdpi/he509.png new file mode 100644 index 0000000..b1a8adb Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he509.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he510.png b/app/src/main/res/drawable-xxxhdpi/he510.png new file mode 100644 index 0000000..eecaf5d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he510.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he511.png b/app/src/main/res/drawable-xxxhdpi/he511.png new file mode 100644 index 0000000..b0bcd8e Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he511.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he512.png b/app/src/main/res/drawable-xxxhdpi/he512.png new file mode 100644 index 0000000..0d98a13 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he512.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he513.png b/app/src/main/res/drawable-xxxhdpi/he513.png new file mode 100644 index 0000000..e1128ff Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he513.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he514.png b/app/src/main/res/drawable-xxxhdpi/he514.png new file mode 100644 index 0000000..cb9adbc Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he514.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he515.png b/app/src/main/res/drawable-xxxhdpi/he515.png new file mode 100644 index 0000000..2faa917 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he515.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he900.png b/app/src/main/res/drawable-xxxhdpi/he900.png new file mode 100644 index 0000000..cbdb3e7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he900.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he901.png b/app/src/main/res/drawable-xxxhdpi/he901.png new file mode 100644 index 0000000..bc6d105 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he901.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/he999.png b/app/src/main/res/drawable-xxxhdpi/he999.png new file mode 100644 index 0000000..4ce8569 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/he999.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_widget_resize_handle.png b/app/src/main/res/drawable-xxxhdpi/ic_widget_resize_handle.png new file mode 100644 index 0000000..e3c45ad Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_widget_resize_handle.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/widget_resize_frame.9.png b/app/src/main/res/drawable-xxxhdpi/widget_resize_frame.9.png new file mode 100644 index 0000000..4644e9a Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/widget_resize_frame.9.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/widget_resize_shadow.9.png b/app/src/main/res/drawable-xxxhdpi/widget_resize_shadow.9.png new file mode 100644 index 0000000..63cea84 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/widget_resize_shadow.9.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/workspace_bg.9.png b/app/src/main/res/drawable-xxxhdpi/workspace_bg.9.png new file mode 100644 index 0000000..3281548 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/workspace_bg.9.png differ diff --git a/app/src/main/res/drawable/actions_item_selector.xml b/app/src/main/res/drawable/actions_item_selector.xml new file mode 100644 index 0000000..cb90c4f --- /dev/null +++ b/app/src/main/res/drawable/actions_item_selector.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bt_checkupdate_normnl.xml b/app/src/main/res/drawable/bt_checkupdate_normnl.xml new file mode 100644 index 0000000..09d53bd --- /dev/null +++ b/app/src/main/res/drawable/bt_checkupdate_normnl.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bt_checkupdate_pressed.xml b/app/src/main/res/drawable/bt_checkupdate_pressed.xml new file mode 100644 index 0000000..8c09552 --- /dev/null +++ b/app/src/main/res/drawable/bt_checkupdate_pressed.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bt_checkupdate_selector.xml b/app/src/main/res/drawable/bt_checkupdate_selector.xml new file mode 100644 index 0000000..7139d84 --- /dev/null +++ b/app/src/main/res/drawable/bt_checkupdate_selector.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/custom_background.xml b/app/src/main/res/drawable/custom_background.xml new file mode 100644 index 0000000..6856ba2 --- /dev/null +++ b/app/src/main/res/drawable/custom_background.xml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/tv_background.xml b/app/src/main/res/drawable/tv_background.xml new file mode 100644 index 0000000..fccd7aa --- /dev/null +++ b/app/src/main/res/drawable/tv_background.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ 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 new file mode 100644 index 0000000..f97bdf7 --- /dev/null +++ b/app/src/main/res/layout-land/fragment_custom.xml @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000..0f6e83c --- /dev/null +++ b/app/src/main/res/layout-port/fragment_custom.xml @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/actions_item.xml b/app/src/main/res/layout/actions_item.xml new file mode 100644 index 0000000..bdbf5a2 --- /dev/null +++ b/app/src/main/res/layout/actions_item.xml @@ -0,0 +1,25 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..0f0b548 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_applist.xml b/app/src/main/res/layout/fragment_applist.xml new file mode 100644 index 0000000..8194e34 --- /dev/null +++ b/app/src/main/res/layout/fragment_applist.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..44261e3 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..44261e3 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..44261e3 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..44261e3 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..44261e3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 0000000..0070722 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..233d13f --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,14 @@ + + + #37353a + #272727 + #454347 + #ffffff + + #FFFFFF + #000000 + #ffffff + + #4880ff + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..3f443ad --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,9 @@ + + + + 16dp + 16dp + 14sp + 10dip + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..d2ba573 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,6 @@ + + 桌面OS + + + Hello blank fragment + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..c478b46 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..1ed50b7 --- /dev/null +++ b/build.gradle @@ -0,0 +1,29 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + jcenter() + maven { url "https://jitpack.io" } + } + dependencies { + classpath 'com.android.tools.build:gradle:3.6.4' + + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + maven { url "https://jitpack.io" } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..ffd1085 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,16 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Mon Nov 01 17:43:31 CST 2021 +android.enableJetifier=true +org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" +android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f6b961f Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..a501ef7 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Oct 30 10:18:10 CST 2021 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..e8fc91f --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name='桌面OS' +include ':app'