main
huangwei 9 months ago
parent 70c130063b
commit bbf6a62804
  1. 1
      app/build.gradle
  2. BIN
      app/libs/colorful-release.aar
  3. 4
      app/src/main/java/com/project/survey/App.java
  4. 4
      app/src/main/java/com/project/survey/ui/base/BaseSurveyNewActivity.java
  5. 3
      app/src/main/java/com/project/survey/ui/home/InstrumentFragment.kt
  6. 1
      app/src/main/java/com/project/survey/ui/instrument/coordinatesystem/BingCeCoordinateSystemActivity.java
  7. 2
      app/src/main/java/com/project/survey/ui/instrument/mobilestationmode/base/AbstractRtkPointCorrectActivity.java
  8. 2
      app/src/main/java/com/project/survey/ui/instrument/satellitosis/SatelliteStatusActivity.java
  9. 2
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/PointStakingActivity.java
  10. 9
      app/src/main/java/com/project/survey/ui/pointmeasure/measure/PointSurveyNewActivity.java
  11. 4
      app/src/main/java/com/project/survey/ui/pointmeasure/measure/util/SurveyToolBarClickListenerUtils.java
  12. 2
      app/src/main/java/com/project/survey/util/BaseSurveyActivityUtils.java
  13. 104
      app/src/main/java/com/project/survey/util/DeviceConnectUtil.java
  14. 5
      app/src/main/res/drawable/icon_menu_sideslip.xml
  15. 370
      app/src/main/res/layout/activity_base_survey_new.xml
  16. 88
      app/src/main/res/layout/activity_satellite_status.xml
  17. 1
      colorful/.gitignore
  18. 44
      colorful/build.gradle
  19. 17
      colorful/proguard-rules.pro
  20. 5
      colorful/src/main/AndroidManifest.xml
  21. 175
      colorful/src/main/java/color/Rcolor.java
  22. 9
      colorful/src/main/java/color/Rdrawable.java
  23. 18
      colorful/src/main/java/color/Rid.java
  24. 18
      colorful/src/main/java/color/Rlayout.java
  25. 9
      colorful/src/main/java/color/Rstring.java
  26. 13
      colorful/src/main/java/color/Rstyle.java
  27. 17
      colorful/src/main/java/color/Rstyleable.java
  28. 54
      colorful/src/main/java/org/polaric/colorful/CircularView.java
  29. 58
      colorful/src/main/java/org/polaric/colorful/ColorPickerAdapter.java
  30. 64
      colorful/src/main/java/org/polaric/colorful/ColorPickerDialog.java
  31. 62
      colorful/src/main/java/org/polaric/colorful/ColorPickerPreference.java
  32. 196
      colorful/src/main/java/org/polaric/colorful/Colorful.java
  33. 75
      colorful/src/main/java/org/polaric/colorful/ColorfulActivity.java
  34. 58
      colorful/src/main/java/org/polaric/colorful/ThemeDelegate.java
  35. 6
      colorful/src/main/java/org/polaric/colorful/Util.java
  36. 4
      colorful/src/main/res/drawable/ic_arrow_back_white_48px.xml
  37. 8
      colorful/src/main/res/layout/adapter_coloritem.xml
  38. 22
      colorful/src/main/res/layout/dialog_colorpicker.xml
  39. 40
      colorful/src/main/res/layout/preference_colorpicker.xml
  40. 7
      colorful/src/main/res/values/attrs.xml
  41. 311
      colorful/src/main/res/values/colors.xml
  42. 3
      colorful/src/main/res/values/strings.xml
  43. 420
      colorful/src/main/res/values/styles.xml
  44. 1
      settings.gradle

@ -150,6 +150,7 @@ dependencies {
implementation Libs.unCrop
implementation Libs.webChatSdk
implementation Libs.xxPermissions
implementation project(':colorful')
annotationProcessor AndroidX.Room.compiler
annotationProcessor Libs.Glide.compiler

Binary file not shown.

@ -124,8 +124,8 @@ public class App extends BaseApp {
private void initThemeDark() {
Colorful.defaults()
.primaryColor(Colorful.ThemeColor.BLUE)
.accentColor(Colorful.ThemeColor.BLUE)
// .primaryColor(Colorful.ThemeColor.SHANG_HAI_PROJECT)
// .accentColor(Colorful.ThemeColor.SHANG_HAI_PROJECT)
.translucent(false)
.dark(false);
Colorful.init(this);

@ -29,7 +29,6 @@ import com.bingce.device.ui.manager.TsMeasSdAnglesManager;
import com.bingce.device.ui.utils.TSSettingDialogUtils;
import com.bingce.rtk.command.RTK;
import com.bingce.rtk.gnss.Gnss;
import com.bingce.surveyor.util.DeviceConnectUtil;
import com.bingce.surveyor.util.SurveyDevicePoleHrHeightUtils;
import com.bingce.totalstation.TsListener;
import com.bingce.utils.PropertiesGet;
@ -41,6 +40,7 @@ import com.project.survey.ui.interfacee.IUIProvider;
import com.project.survey.util.AnimUtil;
import com.project.survey.util.BaseSurveyActivityUtils;
import com.project.survey.util.CountDownUtils;
import com.project.survey.util.DeviceConnectUtil;
import com.project.survey.util.DrawableUtils;
import com.project.survey.util.SystemUtils;
@ -52,7 +52,7 @@ import java.util.List;
import blankj.utilcode.util.ToastUtils;
import blankj.utilcode.util.Utils;
public abstract class BaseSurveyNewActivity extends AppCompatActivity implements IUIProvider, Device.IDeviceConnectListener, RtkManager.IRtkListener,
public abstract class BaseSurveyNewActivity extends ColorfulActivity implements IUIProvider, Device.IDeviceConnectListener, RtkManager.IRtkListener,
TsListener.MeasCoordinateListener, TsListener.MeasSdAnglesListener, TsListener.AnglesRefreshListener, TsListener.BatteryRefreshListener, TsListener.ChangeHrListener,
CountDownUtils.ICountDownSwitcher {
public final BaseSurveyActivityUtils baseSurveyActivityUtils = new BaseSurveyActivityUtils(this, this, onRootSetBackgroundColor());

@ -33,12 +33,15 @@ class InstrumentFragment : BaseFragmentBinding<FragmentInstrumentBinding>() {
override fun initView() {
mBinding.tvConnectTSActivity.setOnClickListener {
//全站仪联机
ConnectTSActivity.start(requireContext())
}
mBinding.tvConnectRtkActivity.setOnClickListener {
//RTK联机
ConnectRtkActivity.start(this)
}
mBinding.tvSatelliteStatusActivity.setOnClickListener {
//卫星状态
startActivity(Intent(requireContext(), SatelliteStatusActivity::class.java))
}
mBinding.tvTotalStationSetupStation.setOnClickListener {

@ -31,6 +31,7 @@ public class BingCeCoordinateSystemActivity extends AutoLandscapeBingCeActivity
ActivityCoordinateSystemBinding binding = ActivityCoordinateSystemBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
Toolbar mToolbar = findViewById(R.id.toolbar);
mToolbar.setTitle(R.string.coordinate_system);
setSupportActionBar(mToolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

@ -38,6 +38,7 @@ import com.bingce.device.ui.coordinatesystem.event.UpdateCoordinateSystemEvent;
import com.bingce.utils.IOnSingleGetCallback;
import com.bingce.utils.ThreadPoolUtil;
import com.bingce.utils.Util;
import com.project.survey.R;
import org.greenrobot.eventbus.EventBus;
import org.polaric.colorful.ColorfulActivity;
@ -69,6 +70,7 @@ public abstract class AbstractRtkPointCorrectActivity extends ColorfulActivity {
super.onCreate(savedInstanceState);
setContentView(Rlayout.activity_point_correct());
bindView();
mToolbar.setTitle(R.string.point_correction);
setSupportActionBar(mToolbar);
if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

@ -6,7 +6,6 @@ import android.view.MenuItem;
import android.view.View;
import com.bingce.device.Device;
import com.bingce.device.ui.databinding.ActivitySatelliteStatusBinding;
import com.bingce.rtk.command.RTK;
import com.bingce.rtk.command.geomax.GeoMaxRTK;
import com.bingce.rtk.enums.SateSystemEnum;
@ -14,6 +13,7 @@ import com.bingce.rtk.model.GnssPosition;
import com.bingce.rtk.parser.nmea0183.SatInfo;
import com.bingce.rtk.parser.nmea0183.SatelliteData;
import com.project.survey.R;
import com.project.survey.databinding.ActivitySatelliteStatusBinding;
import com.project.survey.ui.base.BaseSurveyNewActivity;

@ -46,7 +46,6 @@ import com.bingce.road.move.MoveK;
import com.bingce.road.move.MoveLeftRight;
import com.bingce.surveyor.agentweb.HelpWebActivity;
import com.bingce.surveyor.util.ConstUtils;
import com.bingce.surveyor.util.DeviceConnectUtil;
import com.bingce.surveyor.util.PreferencesUtil;
import com.bingce.surveyor.util.SurveyLimitCheckUtils;
import com.bingce.surveyor.util.SurveyRemarksUtils;
@ -73,6 +72,7 @@ import com.project.survey.ui.lofting.pointlofting.record.RecordsActivity;
import com.project.survey.ui.lofting.pointlofting.record.util.RecordTypeConstants;
import com.project.survey.ui.pointmeasure.measure.util.SurveyToolBarClickListenerUtils;
import com.project.survey.util.CommonUtils;
import com.project.survey.util.DeviceConnectUtil;
import com.project.survey.util.DrawableUtils;
import com.project.survey.util.SurveyUIUtils;

@ -39,15 +39,9 @@ import com.bingce.coordlib.model.Blh;
import com.bingce.coordlib.model.Coordinate;
import com.bingce.coordlib.util.CoordUtil;
import com.bingce.data.DeviceInfoData;
import com.bingce.data.cache.CachedCurrentJob;
import com.bingce.data.cache.CachedCurrentRoad;
import com.bingce.data.cache.CachedProject;
import com.bingce.data.database.CodeDb;
import com.bingce.data.database.DBQueryConstant;
import com.bingce.data.database.JobDb;
import com.bingce.data.database.PointDb;
import com.bingce.data.surveyor.designdata.job.JobConstants;
import com.bingce.data.surveyor.designdata.job.JobRecord;
import com.bingce.data.surveyor.surveydata.code.CodeConstants;
import com.bingce.data.surveyor.surveydata.code.CodeRecord;
import com.bingce.data.surveyor.surveydata.pointsurvey.PointConstants;
@ -55,12 +49,10 @@ import com.bingce.data.surveyor.surveydata.pointsurvey.PointRecord;
import com.bingce.device.Device;
import com.bingce.device.enums.DeviceTypeEnum;
import com.bingce.device.util.DeviceUtils;
import com.bingce.error.BingCeErrorCode;
import com.bingce.rtk.gnss.Gnss;
import com.bingce.rtk.model.GnssPosition;
import com.bingce.surveyor.agentweb.HelpWebActivity;
import com.bingce.surveyor.util.ConstUtils;
import com.bingce.surveyor.util.DeviceConnectUtil;
import com.bingce.surveyor.util.PreferencesUtil;
import com.bingce.surveyor.util.SurveyRemarksUtils;
import com.bingce.surveyor.util.dialog.CustomDialog;
@ -83,6 +75,7 @@ import com.project.survey.ui.instrument.setupstation.LauncherEvent;
import com.project.survey.ui.pointmeasure.measure.util.SFUtils;
import com.project.survey.ui.pointmeasure.measure.util.SurveyToolBarClickListenerUtils;
import com.project.survey.util.CommonUtils;
import com.project.survey.util.DeviceConnectUtil;
import com.project.survey.util.DrawableUtils;
import com.project.survey.util.SurveyUIUtils;
import com.project.survey.widget.bingce.dragdrop.DefaultItemCallback;

@ -14,12 +14,12 @@ import com.bingce.device.Device;
import com.bingce.device.enums.DeviceTypeEnum;
import com.bingce.rtk.command.RTK;
import com.bingce.rtk.gnss.Gnss;
import com.bingce.surveyor.util.DeviceConnectUtil;
import com.bingce.surveyor.util.dialog.CustomDialog;
import com.bingce.surveyorBase.R.string;
import com.bingce.surveyorBase.databinding.ActivityBaseSurveyNewBinding;
import com.bingce.utils.Util;
import com.project.survey.databinding.ActivityBaseSurveyNewBinding;
import com.project.survey.databinding.LayoutBaseSurveyStakingSettingBinding;
import com.project.survey.util.DeviceConnectUtil;
import blankj.utilcode.util.ToastUtils;
import lecho.hellocharts.view.LineChartView;

@ -13,13 +13,13 @@ import com.bingce.device.enums.DeviceTypeEnum;
import com.bingce.rtk.enums.WorkModeEnum;
import com.bingce.rtk.gnss.Gnss;
import com.bingce.rtk.model.GnssPosition;
import com.bingce.surveyorBase.databinding.ActivityBaseSurveyNewBinding;
import com.bingce.totalstation.TotalStation;
import com.bingce.totalstation.TsConfig;
import com.bingce.totalstation.enums.SetupStationModeEnum;
import com.bingce.utils.Util;
import com.gyf.immersionbar.ImmersionBar;
import com.project.survey.R;
import com.project.survey.databinding.ActivityBaseSurveyNewBinding;
import com.project.survey.ui.interfacee.IUIProvider;
import java.util.Locale;

@ -0,0 +1,104 @@
package com.project.survey.util;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import com.bingce.AppChannel;
import com.bingce.device.Device;
import com.bingce.device.enums.DeviceTypeEnum;
import com.bingce.device.ui.ConnectRtkActivity;
import com.bingce.device.ui.ConnectTSActivity;
import com.bingce.surveyor.util.ConstUtils;
import com.bingce.surveyor.util.PreferencesUtil;
import com.bingce.surveyor.util.dialog.CustomRecycleDialog;
import com.bingce.surveyorBase.R;
import com.bingce.totalstation.TsConfig;
import com.bingce.totalstation.enums.SetupStationModeEnum;
import com.bingce.utils.Util;
import com.project.survey.databinding.ActivityBaseSurveyNewBinding;
import java.util.ArrayList;
import java.util.List;
import blankj.utilcode.util.ActivityUtils;
import blankj.utilcode.util.Utils;
public class DeviceConnectUtil {
public static boolean isDeviceConnectSelectDialog(Context context, ActivityBaseSurveyNewBinding activityBaseSurveyBinding) {
if (!Device.getInstance().isDeviceConnected()) {
List<String> stringListDevice = new ArrayList<>();
stringListDevice.add(context.getString(R.string.total_station));
stringListDevice.add(context.getString(R.string.rtk));
CustomRecycleDialog.showDialog(context, R.string.choose_instrument_type, stringListDevice, PreferencesUtil.getLastConnectDeviceType(), false, (index, itemString) -> {
PreferencesUtil.putPreference(ConstUtils.preferConst.lastConnectDeviceType, index);
switch (index) {
case 0:
Intent intent = new Intent(ActivityUtils.getTopActivity(), ConnectTSActivity.class);
intent.putExtra("customChannel", AppChannel.customChannel);
ActivityUtils.getTopActivity().startActivity(intent);
if (TsConfig.getInstance().getSetupStationMethod().getMode() == SetupStationModeEnum.ON_TOTAL_STATION) {
activityBaseSurveyBinding.tvSolutionState.setVisibility(View.GONE);
activityBaseSurveyBinding.tvRtkStatusDiffAge.setVisibility(View.GONE);
activityBaseSurveyBinding.tvRtkStatusHrms.setVisibility(View.GONE);
activityBaseSurveyBinding.tvRtkStatusVrms.setVisibility(View.GONE);
activityBaseSurveyBinding.pivPowerIcon.setVisibility(View.GONE);
activityBaseSurveyBinding.tvPowerNum.setVisibility(View.GONE);
} else {
activityBaseSurveyBinding.tvSolutionState.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.tvRtkStatusDiffAge.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.tvRtkStatusHrms.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.tvRtkStatusVrms.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.pivPowerIcon.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.tvPowerNum.setVisibility(View.VISIBLE);
activityBaseSurveyBinding.pivPowerIcon.setProgress(0);
activityBaseSurveyBinding.pivPowerIcon.setTextSize(0);
activityBaseSurveyBinding.tvSolutionState.setText(String.format("Ha %s", Util.radianToDmsString(0, 0, true)));
activityBaseSurveyBinding.tvRtkStatusDiffAge.setText(String.format("Va %s", Util.radianToDmsString(0, 0, true)));
activityBaseSurveyBinding.tvRtkStatusHrms.setText(String.format("Hd %s", Util.formatDouble2String(0, 3)));
activityBaseSurveyBinding.tvRtkStatusVrms.setText(String.format("Sd %s", Util.formatDouble2String(0, 3)));
}
activityBaseSurveyBinding.tvPoleHighHr.setText("0.000m");
activityBaseSurveyBinding.ivPoleHighHr.setImageDrawable(Utils.getApp().getResources().getDrawable(R.drawable.icon_hr_high_white));
activityBaseSurveyBinding.ivRtkStatusSatellite.setImageDrawable(Utils.getApp().getResources().getDrawable(R.mipmap.icon_edm_np));
activityBaseSurveyBinding.tvRtkStatusSatellite.setText(R.string.laser);
break;
case 1:
Intent intent2 = new Intent(ActivityUtils.getTopActivity(), ConnectRtkActivity.class);
ActivityUtils.getTopActivity().startActivity(intent2);
activityBaseSurveyBinding.tvRtkStatusHrms.setText(Utils.getApp().getString(R.string.no_data));
activityBaseSurveyBinding.tvRtkStatusVrms.setText(Utils.getApp().getString(R.string.no_delay));
activityBaseSurveyBinding.tvSolutionState.setText("");
activityBaseSurveyBinding.tvRtkStatusDiffAge.setText("");
activityBaseSurveyBinding.pivPowerIcon.setProgress(0);
activityBaseSurveyBinding.pivPowerIcon.setTextSize(0);
activityBaseSurveyBinding.tvPoleHighHr.setText("0.000m");
activityBaseSurveyBinding.ivPoleHighHr.setImageDrawable(Utils.getApp().getResources().getDrawable(R.drawable.icon_pole_high_white));
activityBaseSurveyBinding.ivRtkStatusSatellite.setImageDrawable(Utils.getApp().getResources().getDrawable(R.mipmap.icon_home_satellite));
activityBaseSurveyBinding.tvRtkStatusSatellite.setText(String.format("%s %s/%s", Utils.getApp().getString(R.string.satellite), 0, 0));
break;
}
});
return false;
} else {
return true;
}
}
public static void startDeviceConnected(Context context, ActivityBaseSurveyNewBinding activityBaseSurveyBinding) {
if (DeviceConnectUtil.isDeviceConnectSelectDialog(context, activityBaseSurveyBinding)) {
if (Device.getInstance().deviceType == DeviceTypeEnum.DEVICE_TYPE_TS) {
Intent intent = new Intent(ActivityUtils.getTopActivity(), ConnectTSActivity.class);
intent.putExtra("customChannel", AppChannel.customChannel);
ActivityUtils.getTopActivity().startActivity(intent);
} else {
Intent intent2 = new Intent(ActivityUtils.getTopActivity(), ConnectRtkActivity.class);
ActivityUtils.getTopActivity().startActivity(intent2);
}
}
}
}

@ -0,0 +1,5 @@
<vector android:autoMirrored="true" android:height="25dp"
android:viewportHeight="1024" android:viewportWidth="1024"
android:width="25dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ffffff" android:pathData="M916.3,787.2 L104.6,787.2c-21.7,0 -39.2,17.6 -39.2,39.2 0,21.7 17.6,39.2 39.2,39.2l811.8,0c21.7,0 39.2,-17.6 39.2,-39.2C955.6,804.7 938,787.2 916.3,787.2L916.3,787.2zM916.3,473.2 L104.6,473.2c-21.7,0 -39.2,17.6 -39.2,39.2 0,21.6 17.6,39.2 39.2,39.2l811.8,0c21.7,0 39.2,-17.6 39.2,-39.2C955.6,490.7 938,473.2 916.3,473.2L916.3,473.2zM104.6,237.6l811.8,0c21.7,0 39.2,-17.6 39.2,-39.2 0,-21.6 -17.6,-39.2 -39.2,-39.2L104.6,159.2c-21.7,0 -39.2,17.6 -39.2,39.2C65.3,220 82.9,237.6 104.6,237.6L104.6,237.6zM104.6,237.6"/>
</vector>

@ -0,0 +1,370 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?colorPrimary"
android:fitsSystemWindows="true"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_navigation_bar"
android:layout_width="match_parent"
android:layout_height="60dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toStartOf="@+id/rl_more"
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:id="@+id/rl_menu_sideslip"
android:layout_width="60dp"
android:layout_height="match_parent"
android:visibility="gone">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerInParent="true"
android:src="@drawable/icon_menu_sideslip" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_back"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/iv_back"
android:layout_width="28dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="12dp"
android:src="@drawable/icon_back_white" />
<TextView
android:id="@+id/tv_common_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="12dp"
android:layout_toEndOf="@+id/iv_back"
android:ellipsize="end"
android:singleLine="true"
android:text="标题"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="gone" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_road_item_survey_info"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null" />
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinner4"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@null" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_right_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true">
<LinearLayout
android:id="@+id/ll_common_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="@+id/iv_common_right_icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="15dp"
android:src="@mipmap/icon_white_import"
android:visibility="gone" />
<TextView
android:id="@+id/tv_common_right_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:ellipsize="end"
android:singleLine="true"
android:text="import"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_title_bar_right_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="@+id/iv_title_bar_right_icon03"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_white_import" />
<ImageView
android:id="@+id/iv_title_bar_right_icon02"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:src="@mipmap/icon_white_import" />
<ImageView
android:id="@+id/iv_title_bar_right_icon01"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="15dp"
android:src="@mipmap/icon_white_import" />
</LinearLayout>
<LinearLayout
android:id="@+id/rl_survey_info"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:visibility="visible">
<LinearLayout
android:id="@+id/ll_rtk_status"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_solution_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="11sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_rtk_status_diff_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="@color/white"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_rtk_status_hv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:gravity="center_vertical"
android:orientation="vertical">
<com.bingce.device.ui.widget.BingCeTextView
android:id="@+id/tv_rtk_status_hrms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no_data"
android:textColor="@color/white"
android:textSize="11sp"
android:textStyle="bold" />
<com.bingce.device.ui.widget.BingCeTextView
android:id="@+id/tv_rtk_status_vrms"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/no_delay"
android:textColor="@color/white"
android:textSize="11sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_pole_high_hr"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_pole_high_hr"
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@drawable/icon_pole_high_white" />
<com.bingce.device.ui.widget.BingCeTextView
android:id="@+id/tv_pole_high_hr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="0.00"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_icon_home_satellite"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_rtk_status_satellite"
android:layout_width="18dp"
android:layout_height="18dp"
android:src="@mipmap/icon_home_satellite" />
<TextView
android:id="@+id/tv_rtk_status_satellite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="0/0"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_power"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:gravity="center"
android:orientation="vertical">
<com.bingce.surveyor.widget.PowerBatteryView
android:id="@+id/piv_power_icon"
android:layout_width="20.5dp"
android:layout_height="7.5dp"
android:layout_marginTop="5dp"
android:rotation="270" />
<TextView
android:id="@+id/tv_power_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="0%"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_more"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="15dp">
<ImageView
android:id="@+id/iv_more"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_centerInParent="true"
android:src="@drawable/icon_white_more" />
</RelativeLayout>
</RelativeLayout>
<com.daimajia.numberprogressbar.NumberProgressBar
android:id="@+id/cut_down_progressbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/theme_gray"
android:visibility="gone"
custom:progress_current="600"
custom:progress_max="600"
custom:progress_reached_bar_height="1dp"
custom:progress_text_size="6sp"
custom:progress_text_visibility="visible"
custom:progress_unreached_bar_height="1dp"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/base_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/theme_gray"
android:orientation="vertical" />
</LinearLayout>

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.bingce.device.ui.rtk.SatelliteSkyView
android:id="@+id/activity_satellite_status_skyview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/activity_satellite_status_view_satellite_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/tracked_satellite_number" />
<TextView
android:id="@+id/activity_satellite_status_solution_satellite_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/solution_satellite_number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/activity_satellite_status_system"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
<TextView
android:id="@+id/activity_satellite_status_prn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
<TextView
android:id="@+id/activity_satellite_status_elevation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
<TextView
android:id="@+id/activity_satellite_status_azimuth"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
<TextView
android:id="@+id/activity_satellite_status_snr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>

@ -0,0 +1 @@
/build

@ -0,0 +1,44 @@
import com.bingce.AndroidSdk
import com.bingce.AndroidX
import com.bingce.BcFolder
apply plugin: 'com.android.library'
android {
compileSdk AndroidSdk.compileSdkVersion
namespace 'org.polaric.colorful'
defaultConfig {
minSdkVersion AndroidSdk.minSdkVersion
targetSdkVersion AndroidSdk.targetSdkVersion
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
sourceSets {
main {
java {
def bcFolder = new BcFolder(project)
srcDirs = [
new File(bcFolder.rootProjectDir(), "base/buildSrc/color/main/java"),//RBuildConfig资源
new File("src/main/java")
]
}
}
}
}
dependencies {
implementation AndroidX.appcompat
implementation AndroidX.recyclerview
implementation AndroidX.legacyPreference
implementation AndroidX.Lifecycle.extensions
}

@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/polaric/Documents/Code/SDK/android-sdk-linux/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# 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 *;
#}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.polaric.colorful">
<application />
</manifest>

@ -0,0 +1,175 @@
package color;
import org.polaric.colorful.R;
public class Rcolor {
public static int shang_hai_project_color() {
return R.color.shang_hai_color;
}
public static int md_red_500() {
return R.color.md_red_500;
}
public static int md_red_700() {
return R.color.md_red_700;
}
public static int md_pink_500() {
return R.color.md_pink_500;
}
public static int md_pink_700() {
return R.color.md_pink_700;
}
public static int md_purple_500() {
return R.color.md_purple_500;
}
public static int md_purple_700() {
return R.color.md_purple_700;
}
public static int md_deep_purple_500() {
return R.color.md_deep_purple_500;
}
public static int md_deep_purple_700() {
return R.color.md_deep_purple_700;
}
public static int md_indigo_500() {
return R.color.md_indigo_500;
}
public static int md_indigo_700() {
return R.color.md_indigo_700;
}
public static int md_blue_500() {
return R.color.md_blue_500;
}
public static int md_blue_700() {
return R.color.md_blue_700;
}
public static int md_light_blue_500() {
return R.color.md_light_blue_500;
}
public static int md_light_blue_700() {
return R.color.md_light_blue_700;
}
public static int ufo_blue() {
return R.color.ufo_blue;
}
public static int alpha_black() {
return R.color.alpha_black;
}
public static int alpha_green() {
return R.color.alpha_green;
}
public static int md_teal_500() {
return R.color.md_teal_500;
}
public static int md_teal_700() {
return R.color.md_teal_700;
}
public static int md_green_500() {
return R.color.md_green_500;
}
public static int md_green_700() {
return R.color.md_green_700;
}
public static int md_light_green_500() {
return R.color.md_light_green_500;
}
public static int md_light_green_700() {
return R.color.md_light_green_700;
}
public static int md_lime_500() {
return R.color.md_lime_500;
}
public static int md_lime_700() {
return R.color.md_lime_700;
}
public static int md_yellow_500() {
return R.color.md_yellow_500;
}
public static int md_yellow_700() {
return R.color.md_yellow_700;
}
public static int md_amber_500() {
return R.color.md_amber_500;
}
public static int md_amber_700() {
return R.color.md_amber_700;
}
public static int md_orange_500() {
return R.color.md_orange_500;
}
public static int md_orange_700() {
return R.color.md_orange_700;
}
public static int md_deep_orange_500() {
return R.color.md_deep_orange_500;
}
public static int md_deep_orange_700() {
return R.color.md_deep_orange_700;
}
public static int md_brown_500() {
return R.color.md_brown_500;
}
public static int md_brown_700() {
return R.color.md_brown_700;
}
public static int md_grey_500() {
return R.color.md_grey_500;
}
public static int md_grey_700() {
return R.color.md_grey_700;
}
public static int md_blue_grey_500() {
return R.color.md_blue_grey_500;
}
public static int md_blue_grey_700() {
return R.color.md_blue_grey_700;
}
public static int md_white_1000() {
return R.color.md_white_1000;
}
public static int md_black_1000() {
return R.color.md_black_1000;
}
}

@ -0,0 +1,9 @@
package color;
import org.polaric.colorful.R;
public class Rdrawable {
public static int ic_arrow_back_white_48px() {
return R.drawable.ic_arrow_back_white_48px;
}
}

@ -0,0 +1,18 @@
package color;
import org.polaric.colorful.R;
public class Rid {
public static int color_indicator() {
return R.id.color_indicator;
}
public static int colorful_color_picker_recycler() {
return R.id.colorful_color_picker_recycler;
}
public static int colorful_color_picker_toolbar() {
return R.id.colorful_color_picker_toolbar;
}
}

@ -0,0 +1,18 @@
package color;
import org.polaric.colorful.R;
public class Rlayout {
public static int preference_colorpicker() {
return R.layout.preference_colorpicker;
}
public static int dialog_colorpicker() {
return R.layout.dialog_colorpicker;
}
public static int adapter_coloritem() {
return R.layout.adapter_coloritem;
}
}

@ -0,0 +1,9 @@
package color;
import org.polaric.colorful.R;
public class Rstring {
public static int select_color() {
return R.string.select_color;
}
}

@ -0,0 +1,13 @@
package color;
import org.polaric.colorful.R;
public class Rstyle {
public static int Colorful_Light() {
return R.style.Colorful_Light;
}
public static int Colorful_Dark() {
return R.style.Colorful_Dark;
}
}

@ -0,0 +1,17 @@
package color;
import org.polaric.colorful.R;
public class Rstyleable {
public static int[] colorpicker() {
return R.styleable.colorpicker;
}
public static int colorpicker_primary_color() {
return R.styleable.colorpicker_primary_color;
}
public static int colorpicker_accent_color() {
return R.styleable.colorpicker_accent_color;
}
}

@ -0,0 +1,54 @@
package org.polaric.colorful;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.ColorInt;
import androidx.annotation.RequiresApi;
public class CircularView extends View {
Paint paint = new Paint();
Paint paint2 = new Paint();//灰色描边
public CircularView(Context context) {
super(context);
}
public CircularView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CircularView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@RequiresApi(21)
public CircularView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public void setColor(@ColorInt int color) {
paint.setColor(color);
paint2.setStyle(Paint.Style.STROKE);
paint2.setStrokeWidth(4);
paint2.setColor(Color.LTGRAY);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawCircle(canvas.getWidth() / 2, canvas.getHeight() / 2, canvas.getWidth() / 2 - 9, paint);
canvas.drawCircle(canvas.getWidth() / 2, canvas.getHeight() / 2, canvas.getWidth() / 2 - 5, paint2);
}
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int size = Math.min(getMeasuredWidth(), getMeasuredHeight());
setMeasuredDimension(size, size);
}
}

@ -0,0 +1,58 @@
package org.polaric.colorful;
import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import color.Rlayout;
class ColorPickerAdapter extends RecyclerView.Adapter<ColorPickerAdapter.ItemViewHolder> {
private Context context;
private OnItemClickListener listener;
ColorPickerAdapter(Context context) {
this.context=context;
}
@Override
public int getItemCount() {
return Colorful.ThemeColor.values().length;
}
@Override
public void onBindViewHolder(ItemViewHolder ViewHolder, int i) {
ViewHolder.circle.setColor(context.getResources().getColor(Colorful.ThemeColor.values()[i].getColorRes()));
}
@Override
public ItemViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
final ItemViewHolder holder = new ItemViewHolder(LayoutInflater.from(context).inflate(Rlayout.adapter_coloritem(), viewGroup, false));
holder.circle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener!=null) {
listener.onItemClick(Colorful.ThemeColor.values()[holder.getAdapterPosition()]);
}
}
});
return holder;
}
void setOnItemClickListener(OnItemClickListener l) {
listener=l;
}
static class ItemViewHolder extends RecyclerView.ViewHolder {
CircularView circle;
ItemViewHolder(View v) {
super(v);
circle = ((CircularView) v);
}
}
interface OnItemClickListener {
void onItemClick(Colorful.ThemeColor color);
}
}

@ -0,0 +1,64 @@
package org.polaric.colorful;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import color.Rdrawable;
import color.Rid;
import color.Rlayout;
import color.Rstring;
public class ColorPickerDialog extends Dialog implements View.OnClickListener, ColorPickerAdapter.OnItemClickListener {
private RecyclerView recycler;
private Toolbar toolbar;
private OnColorSelectedListener listener;
public ColorPickerDialog(Context context) {
super(context);
}
@Override
public void onClick(View view) {
dismiss();
}
@Override
public void onItemClick(Colorful.ThemeColor color) {
dismiss();
if (listener!=null) {
listener.onColorSelected(color);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(Rlayout.dialog_colorpicker());
recycler = ((RecyclerView) findViewById(Rid.colorful_color_picker_recycler()));
toolbar = ((Toolbar) findViewById(Rid.colorful_color_picker_toolbar()));
toolbar.setNavigationOnClickListener(this);
toolbar.setBackgroundColor(getContext().getResources().getColor(Colorful.getThemeDelegate().getPrimaryColor().getColorRes()));
toolbar.setTitle(Rstring.select_color());
toolbar.setNavigationIcon(Rdrawable.ic_arrow_back_white_48px());
recycler.setLayoutManager(new GridLayoutManager(getContext(), 4));
ColorPickerAdapter adapter = new ColorPickerAdapter(getContext());
adapter.setOnItemClickListener(this);
recycler.setAdapter(adapter);
}
public interface OnColorSelectedListener {
void onColorSelected(Colorful.ThemeColor color);
}
public void setOnColorSelectedListener(OnColorSelectedListener listener) {
this.listener=listener;
}
}

@ -0,0 +1,62 @@
package org.polaric.colorful;
import android.content.Context;
import android.content.res.TypedArray;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
import android.util.AttributeSet;
import color.Rid;
import color.Rlayout;
import color.Rstyleable;
public class ColorPickerPreference extends Preference implements ColorPickerDialog.OnColorSelectedListener {
private boolean primary;
private boolean accent;
public ColorPickerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setWidgetLayoutResource(Rlayout.preference_colorpicker());
TypedArray ta = context.obtainStyledAttributes(attrs, Rstyleable.colorpicker());
try {
primary = ta.getBoolean(Rstyleable.colorpicker_primary_color(),false);
accent = ta.getBoolean(Rstyleable.colorpicker_accent_color(), false);
} finally {
ta.recycle();
}
}
@Override
public void onColorSelected(Colorful.ThemeColor color) {
if (primary) {
Colorful.config(getContext())
.primaryColor(color)
.apply();
} else if (accent) {
Colorful.config(getContext())
.accentColor(color)
.apply();
}
if (getOnPreferenceChangeListener()!=null) {
getOnPreferenceChangeListener().onPreferenceChange(this, color);
}
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
if (primary) {
((CircularView) holder.findViewById(Rid.color_indicator())).setColor(getContext().getResources().getColor(Colorful.getThemeDelegate().getPrimaryColor().getColorRes()));
} else if (accent) {
((CircularView) holder.findViewById(Rid.color_indicator())).setColor(getContext().getResources().getColor(Colorful.getThemeDelegate().getAccentColor().getColorRes()));
}
}
@Override
protected void onClick() {
super.onClick();
ColorPickerDialog dialog = new ColorPickerDialog(getContext());
dialog.setOnColorSelectedListener(this);
dialog.show();
}
}

@ -0,0 +1,196 @@
package org.polaric.colorful;
import android.app.Activity;
import android.content.Context;
import android.util.Log;
import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import color.Rcolor;
public class Colorful {
private static ThemeDelegate delegate;
private static ThemeColor primaryColor = Defaults.primaryColor;
private static ThemeColor accentColor = Defaults.accentColor;
private static boolean isTranslucent = Defaults.trans;
private static boolean isDark = Defaults.darkTheme;
private static String themeString;
private Colorful() {
// prevent initialization
}
public static void init(Context context) {
Log.d(Util.LOG_TAG, "Attatching to " + context.getPackageName());
themeString = PreferenceManager.getDefaultSharedPreferences(context).getString(Util.PREFERENCE_KEY, null);
if (themeString == null) {
primaryColor = Defaults.primaryColor;
accentColor = Defaults.accentColor;
isTranslucent = Defaults.trans;
isDark = Defaults.darkTheme;
themeString = generateThemeString();
} else {
initValues();
}
delegate = new ThemeDelegate(context, primaryColor, accentColor, isTranslucent, isDark);
}
public static void applyTheme(@NonNull Activity activity) {
applyTheme(activity, true);
}
public static void applyTheme(@NonNull Activity activity, boolean overrideBase) {
if (overrideBase) {
activity.setTheme(getThemeDelegate().getStyleResBase());
}
activity.getTheme().applyStyle(getThemeDelegate().getStyleResPrimary(), true);
activity.getTheme().applyStyle(getThemeDelegate().getStyleResAccent(), true);
}
private static void writeValues(Context context) {
PreferenceManager.getDefaultSharedPreferences(context).edit().putString(Util.PREFERENCE_KEY, generateThemeString()).apply();
}
private static void initValues() {
String[] colors = themeString.split(":");
isDark = Boolean.parseBoolean(colors[0]);
isTranslucent = Boolean.parseBoolean(colors[1]);
primaryColor = Colorful.ThemeColor.values()[Integer.parseInt(colors[2])];
accentColor = Colorful.ThemeColor.values()[Integer.parseInt(colors[3])];
}
private static String generateThemeString() {
return isDark + ":" + isTranslucent + ":" + primaryColor.ordinal() + ":" + accentColor.ordinal();
}
public static ThemeDelegate getThemeDelegate() {
if (delegate == null) {
Log.e(Util.LOG_TAG, "getThemeDelegate() called before init(Context). Call Colorful.init(Context) in your application class");
}
return delegate;
}
public static String getThemeString() {
return themeString;
}
public enum ThemeColor {
SHANG_HAI_PROJECT(Rcolor.shang_hai_project_color(), Rcolor.shang_hai_project_color());
// RED(Rcolor.md_red_500(), Rcolor.md_red_700()),
// PINK(Rcolor.md_pink_500(), Rcolor.md_pink_700()),
// PURPLE(Rcolor.md_purple_500(), Rcolor.md_purple_700()),
// DEEP_PURPLE(Rcolor.md_deep_purple_500(), Rcolor.md_deep_purple_700()),
// INDIGO(Rcolor.md_indigo_500(), Rcolor.md_indigo_700()),
// BLUE(Rcolor.md_blue_500(), Rcolor.md_blue_700()),
// LIGHT_BLUE(Rcolor.md_light_blue_500(), Rcolor.md_light_blue_700()),
// // CYAN(Rcolor.md_cyan_500, Rcolor.md_cyan_700),
// UFO_BLUE(Rcolor.ufo_blue(), Rcolor.ufo_blue()),
// TEAL(Rcolor.md_teal_500(), Rcolor.md_teal_700()),
// GREEN(Rcolor.md_green_500(), Rcolor.md_green_700()),
// LIGHT_GREEN(Rcolor.md_light_green_500(), Rcolor.md_light_green_700()),
// LIME(Rcolor.md_lime_500(), Rcolor.md_lime_700()),
// YELLOW(Rcolor.md_yellow_500(), Rcolor.md_yellow_700()),
// AMBER(Rcolor.md_amber_500(), Rcolor.md_amber_700()),
// ORANGE(Rcolor.md_orange_500(), Rcolor.md_orange_700()),
// DEEP_ORANGE(Rcolor.md_deep_orange_500(), Rcolor.md_deep_orange_700()),
// BROWN(Rcolor.md_brown_500(), Rcolor.md_brown_700()),
// GREY(Rcolor.md_grey_500(), Rcolor.md_grey_700()),
// BLUE_GREY(Rcolor.md_blue_grey_500(), Rcolor.md_blue_grey_700()),
// WHITE(Rcolor.md_white_1000(), Rcolor.md_white_1000()),
// BLACK(Rcolor.md_black_1000(), Rcolor.md_black_1000()),
// ALPHA_BLACK(Rcolor.alpha_black(), Rcolor.alpha_black()),
// ALPHA_GREEN(Rcolor.alpha_green(), Rcolor.alpha_green());
@ColorRes
private int colorRes;
@ColorRes
private int darkColorRes;
ThemeColor(@ColorRes int colorRes, @ColorRes int darkColorRes) {
this.colorRes = colorRes;
this.darkColorRes = darkColorRes;
}
public @ColorRes
int getColorRes() {
return colorRes;
}
public @ColorRes
int getDarkColorRes() {
return darkColorRes;
}
}
public static Config config(Context context) {
return new Config(context);
}
public static Defaults defaults() {
return new Defaults();
}
public static class Defaults {
private static ThemeColor primaryColor = ThemeColor.SHANG_HAI_PROJECT;
private static ThemeColor accentColor = ThemeColor.SHANG_HAI_PROJECT;
private static boolean trans = false;
private static boolean darkTheme = false;
public Defaults primaryColor(ThemeColor primary) {
primaryColor = primary;
return this;
}
public Defaults accentColor(ThemeColor accent) {
accentColor = accent;
return this;
}
public Defaults translucent(boolean translucent) {
trans = translucent;
return this;
}
public Defaults dark(boolean dark) {
darkTheme = dark;
return this;
}
}
public static class Config {
private Context context;
private Config(Context context) {
this.context = context;
}
public Config primaryColor(ThemeColor primary) {
primaryColor = primary;
return this;
}
public Config accentColor(ThemeColor accent) {
accentColor = accent;
return this;
}
public Config translucent(boolean translucent) {
isTranslucent = translucent;
return this;
}
public Config dark(boolean dark) {
isDark = dark;
return this;
}
public void apply() {
writeValues(context);
themeString = generateThemeString();
delegate = new ThemeDelegate(context, primaryColor, accentColor, isTranslucent, isDark);
}
}
}

@ -0,0 +1,75 @@
package org.polaric.colorful;
import android.app.ActivityManager;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
public abstract class ColorfulActivity extends AppCompatActivity {
private String themeString;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
themeString = Colorful.getThemeString();
setTheme(Colorful.getThemeDelegate().getStyleResBase());
// getTheme().applyStyle(Colorful.getThemeDelegate().getStyleResPrimary(), true);
// getTheme().applyStyle(Colorful.getThemeDelegate().getStyleResAccent(), true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (Colorful.getThemeDelegate().isTranslucent()) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
ActivityManager.TaskDescription tDesc = new ActivityManager.TaskDescription(null, null, getResources().getColor(Colorful.getThemeDelegate().getPrimaryColor().getColorRes()));
setTaskDescription(tDesc);
}
}
@Override
public void setContentView(View view) {
//判断view的背景色
autoSwitchRootViewBgColor(view);
super.setContentView(view);
}
@Override
protected void onResume() {
super.onResume();
if (!Colorful.getThemeString().equals(themeString)) {
Log.d(Util.LOG_TAG, "Theme change detected, restarting activity");
recreate();
}
}
public static void autoSwitchRootViewBgColor(View contentView) {
if (contentView == null) {
return;
}
//判断contentView是否设置了颜色,如果是,就跳过
Drawable bg = contentView.getBackground();
if (bg != null) {
if (bg instanceof ColorDrawable) {
ColorDrawable colorDrawable = (ColorDrawable) bg;
Log.d("___bg____", "color:" + colorDrawable.getColor());
} else {
Log.d("___bg____", bg.toString());
}
return;
}
int bgColor = useDarkTheme ? R.color.app_background_color_night : R.color.app_background_color_day;
contentView.setBackgroundColor(contentView.getContext().getResources().getColor(bgColor));
}
public static void onThemeChanged(boolean useDarkColor) {
useDarkTheme = useDarkColor;
}
private static boolean useDarkTheme = false;
}

@ -0,0 +1,58 @@
package org.polaric.colorful;
import android.content.Context;
import android.util.Log;
import androidx.annotation.StyleRes;
import color.Rstyle;
public class ThemeDelegate {
private Colorful.ThemeColor primaryColor;
private Colorful.ThemeColor accentColor;
private boolean translucent;
private boolean dark;
@StyleRes private int styleResPrimary;
@StyleRes private int styleResAccent;
@StyleRes private int styleResBase;
ThemeDelegate(Context context, Colorful.ThemeColor primary, Colorful.ThemeColor accent, boolean translucent, boolean dark) {
this.primaryColor=primary;
this.accentColor=accent;
this.translucent=translucent;
this.dark=dark;
long curTime = System.currentTimeMillis();
// styleResPrimary = context.getResources().getIdentifier("primary" + primary.ordinal(), "style", context.getPackageName());
// styleResAccent = context.getResources().getIdentifier("accent" + accent.ordinal(), "style", context.getPackageName());
styleResBase = dark ? Rstyle.Colorful_Dark() : Rstyle.Colorful_Light();
Log.d(Util.LOG_TAG, "ThemeDelegate fetched theme in " + (System.currentTimeMillis()-curTime) + " milliseconds");
}
@StyleRes public int getStyleResPrimary() {
return styleResPrimary;
}
@StyleRes public int getStyleResAccent() {
return styleResAccent;
}
@StyleRes public int getStyleResBase() {
return styleResBase;
}
public Colorful.ThemeColor getPrimaryColor() {
return primaryColor;
}
public Colorful.ThemeColor getAccentColor() {
return accentColor;
}
public boolean isTranslucent() {
return translucent;
}
public boolean isDark() {
return dark;
}
}

@ -0,0 +1,6 @@
package org.polaric.colorful;
class Util {
static final String LOG_TAG="Colorful";
static final String PREFERENCE_KEY="COLORFUL_PREF_KEY";
}

@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<org.polaric.colorful.CircularView
android:layout_margin="8dp"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
/>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/colorful_color_picker_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:theme="@style/Colorful.Dark"
app:popupTheme="@style/Colorful.Dark"/>
<androidx.recyclerview.widget.RecyclerView
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:id="@+id/colorful_color_picker_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="?android:attr/selectableItemBackground" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dip"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="4" />
</RelativeLayout>
<org.polaric.colorful.CircularView
android:id="@+id/color_indicator"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center_vertical"/>
</LinearLayout>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="colorpicker">
<attr name="primary_color" format="boolean"/>
<attr name="accent_color" format="boolean"/>
</declare-styleable>
</resources>

@ -0,0 +1,311 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<color name="shang_hai_color">#2964DA</color>
<color name="colorPrimary">#2964DA</color>
<color name="c_ebebeb">#EBEBEB</color>
<!--red-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
<color name="md_red_300">#E57373</color>
<color name="md_red_400">#EF5350</color>
<color name="md_red_500">#F44336</color>
<color name="md_red_600">#E53935</color>
<color name="md_red_700">#D32F2F</color>
<color name="md_red_800">#C62828</color>
<color name="md_red_900">#B71C1C</color>
<color name="md_red_A100">#FF8A80</color>
<color name="md_red_A200">#FF5252</color>
<color name="md_red_A400">#FF1744</color>
<color name="md_red_A700">#D50000</color>
<!--pink-->
<color name="md_pink_50">#FCE4EC</color>
<color name="md_pink_100">#F8BBD0</color>
<color name="md_pink_200">#F48FB1</color>
<color name="md_pink_300">#F06292</color>
<color name="md_pink_400">#EC407A</color>
<color name="md_pink_500">#E91E63</color>
<color name="md_pink_600">#D81B60</color>
<color name="md_pink_700">#C2185B</color>
<color name="md_pink_800">#AD1457</color>
<color name="md_pink_900">#880E4F</color>
<color name="md_pink_A100">#FF80AB</color>
<color name="md_pink_A200">#FF4081</color>
<color name="md_pink_A400">#F50057</color>
<color name="md_pink_A700">#C51162</color>
<!--purple-->
<color name="md_purple_50">#F3E5F5</color>
<color name="md_purple_100">#E1BEE7</color>
<color name="md_purple_200">#CE93D8</color>
<color name="md_purple_300">#BA68C8</color>
<color name="md_purple_400">#AB47BC</color>
<color name="md_purple_500">#9C27B0</color>
<color name="md_purple_600">#8E24AA</color>
<color name="md_purple_700">#7B1FA2</color>
<color name="md_purple_800">#6A1B9A</color>
<color name="md_purple_900">#4A148C</color>
<color name="md_purple_A100">#EA80FC</color>
<color name="md_purple_A200">#E040FB</color>
<color name="md_purple_A400">#D500F9</color>
<color name="md_purple_A700">#AA00FF</color>
<!--deep_purples-->
<color name="md_deep_purple_50">#EDE7F6</color>
<color name="md_deep_purple_100">#D1C4E9</color>
<color name="md_deep_purple_200">#B39DDB</color>
<color name="md_deep_purple_300">#9575CD</color>
<color name="md_deep_purple_400">#7E57C2</color>
<color name="md_deep_purple_500">#673AB7</color>
<color name="md_deep_purple_600">#5E35B1</color>
<color name="md_deep_purple_700">#512DA8</color>
<color name="md_deep_purple_800">#4527A0</color>
<color name="md_deep_purple_900">#311B92</color>
<color name="md_deep_purple_A100">#B388FF</color>
<color name="md_deep_purple_A200">#7C4DFF</color>
<color name="md_deep_purple_A400">#651FFF</color>
<color name="md_deep_purple_A700">#6200EA</color>
<!--indigo-->
<color name="md_indigo_50">#E8EAF6</color>
<color name="md_indigo_100">#C5CAE9</color>
<color name="md_indigo_200">#9FA8DA</color>
<color name="md_indigo_300">#7986CB</color>
<color name="md_indigo_400">#5C6BC0</color>
<color name="md_indigo_500">#3F51B5</color>
<color name="md_indigo_600">#3949AB</color>
<color name="md_indigo_700">#303F9F</color>
<color name="md_indigo_800">#283593</color>
<color name="md_indigo_900">#1A237E</color>
<color name="md_indigo_A100">#8C9EFF</color>
<color name="md_indigo_A200">#536DFE</color>
<color name="md_indigo_A400">#3D5AFE</color>
<color name="md_indigo_A700">#304FFE</color>
<!--blue-->
<color name="md_blue_50">#E3F2FD</color>
<color name="md_blue_100">#BBDEFB</color>
<color name="md_blue_200">#90CAF9</color>
<color name="md_blue_300">#64B5F6</color>
<color name="md_blue_400">#42A5F5</color>
<color name="md_blue_500">#2196F3</color>
<color name="md_blue_600">#1E88E5</color>
<color name="md_blue_700">#1976D2</color>
<color name="md_blue_800">#1565C0</color>
<color name="md_blue_900">#0D47A1</color>
<color name="md_blue_A100">#82B1FF</color>
<color name="md_blue_A200">#448AFF</color>
<color name="md_blue_A400">#2979FF</color>
<color name="md_blue_A700">#2962FF</color>
<!--light_blue-->
<color name="md_light_blue_50">#E1F5FE</color>
<color name="md_light_blue_100">#B3E5FC</color>
<color name="md_light_blue_200">#81D4fA</color>
<color name="md_light_blue_300">#4fC3F7</color>
<color name="md_light_blue_400">#29B6FC</color>
<color name="md_light_blue_500">#03A9F4</color>
<color name="md_light_blue_600">#039BE5</color>
<color name="md_light_blue_700">#0288D1</color>
<color name="md_light_blue_800">#0277BD</color>
<color name="md_light_blue_900">#01579B</color>
<color name="md_light_blue_A100">#80D8FF</color>
<color name="md_light_blue_A200">#40C4FF</color>
<color name="md_light_blue_A400">#00B0FF</color>
<color name="md_light_blue_A700">#0091EA</color>
<!--cyan-->
<color name="md_cyan_50">#E0F7FA</color>
<color name="md_cyan_100">#B2EBF2</color>
<color name="md_cyan_200">#80DEEA</color>
<color name="md_cyan_300">#4DD0E1</color>
<color name="md_cyan_400">#26C6DA</color>
<color name="md_cyan_500">#00BCD4</color>
<color name="md_cyan_600">#00ACC1</color>
<color name="md_cyan_700">#0097A7</color>
<color name="md_cyan_800">#00838F</color>
<color name="md_cyan_900">#006064</color>
<color name="md_cyan_A100">#84FFFF</color>
<color name="md_cyan_A200">#18FFFF</color>
<color name="md_cyan_A400">#00E5FF</color>
<color name="md_cyan_A700">#00B8D4</color>
<!--teal-->
<color name="md_teal_50">#E0F2F1</color>
<color name="md_teal_100">#B2DFDB</color>
<color name="md_teal_200">#80CBC4</color>
<color name="md_teal_300">#4DB6AC</color>
<color name="md_teal_400">#26A69A</color>
<color name="md_teal_500">#009688</color>
<color name="md_teal_600">#00897B</color>
<color name="md_teal_700">#00796B</color>
<color name="md_teal_800">#00695C</color>
<color name="md_teal_900">#004D40</color>
<color name="md_teal_A100">#A7FFEB</color>
<color name="md_teal_A200">#64FFDA</color>
<color name="md_teal_A400">#1DE9B6</color>
<color name="md_teal_A700">#00BFA5</color>
<!--green-->
<color name="md_green_50">#E8F5E9</color>
<color name="md_green_100">#C8E6C9</color>
<color name="md_green_200">#A5D6A7</color>
<color name="md_green_300">#81C784</color>
<color name="md_green_400">#66BB6A</color>
<color name="md_green_500">#4CAF50</color>
<color name="md_green_600">#43A047</color>
<color name="md_green_700">#388E3C</color>
<color name="md_green_800">#2E7D32</color>
<color name="md_green_900">#1B5E20</color>
<color name="md_green_A100">#B9F6CA</color>
<color name="md_green_A200">#69F0AE</color>
<color name="md_green_A400">#00E676</color>
<color name="md_green_A700">#00C853</color>
<!--light_green-->
<color name="md_light_green_50">#F1F8E9</color>
<color name="md_light_green_100">#DCEDC8</color>
<color name="md_light_green_200">#C5E1A5</color>
<color name="md_light_green_300">#AED581</color>
<color name="md_light_green_400">#9CCC65</color>
<color name="md_light_green_500">#8BC34A</color>
<color name="md_light_green_600">#7CB342</color>
<color name="md_light_green_700">#689F38</color>
<color name="md_light_green_800">#558B2F</color>
<color name="md_light_green_900">#33691E</color>
<color name="md_light_green_A100">#CCFF90</color>
<color name="md_light_green_A200">#B2FF59</color>
<color name="md_light_green_A400">#76FF03</color>
<color name="md_light_green_A700">#64DD17</color>
<!--lime-->
<color name="md_lime_50">#F9FBE7</color>
<color name="md_lime_100">#F0F4C3</color>
<color name="md_lime_200">#E6EE9C</color>
<color name="md_lime_300">#DCE775</color>
<color name="md_lime_400">#D4E157</color>
<color name="md_lime_500">#CDDC39</color>
<color name="md_lime_600">#C0CA33</color>
<color name="md_lime_700">#A4B42B</color>
<color name="md_lime_800">#9E9D24</color>
<color name="md_lime_900">#827717</color>
<color name="md_lime_A100">#F4FF81</color>
<color name="md_lime_A200">#EEFF41</color>
<color name="md_lime_A400">#C6FF00</color>
<color name="md_lime_A700">#AEEA00</color>
<!--yellow -->
<color name="md_yellow_50">#FFFDE7</color>
<color name="md_yellow_100">#FFF9C4</color>
<color name="md_yellow_200">#FFF590</color>
<color name="md_yellow_300">#FFF176</color>
<color name="md_yellow_400">#FFEE58</color>
<color name="md_yellow_500">#FFEB3B</color>
<color name="md_yellow_600">#FDD835</color>
<color name="md_yellow_700">#FBC02D</color>
<color name="md_yellow_800">#F9A825</color>
<color name="md_yellow_900">#F57F17</color>
<color name="md_yellow_A100">#FFFF82</color>
<color name="md_yellow_A200">#FFFF00</color>
<color name="md_yellow_A400">#FFEA00</color>
<color name="md_yellow_A700">#FFD600</color>
<!--amber-->
<color name="md_amber_50">#FFF8E1</color>
<color name="md_amber_100">#FFECB3</color>
<color name="md_amber_200">#FFE082</color>
<color name="md_amber_300">#FFD54F</color>
<color name="md_amber_400">#FFCA28</color>
<color name="md_amber_500">#FFC107</color>
<color name="md_amber_600">#FFB300</color>
<color name="md_amber_700">#FFA000</color>
<color name="md_amber_800">#FF8F00</color>
<color name="md_amber_900">#FF6F00</color>
<color name="md_amber_A100">#FFE57F</color>
<color name="md_amber_A200">#FFD740</color>
<color name="md_amber_A400">#FFC400</color>
<color name="md_amber_A700">#FFAB00</color>
<!--orange-->
<color name="md_orange_50">#FFF3E0</color>
<color name="md_orange_100">#FFE0B2</color>
<color name="md_orange_200">#FFCC80</color>
<color name="md_orange_300">#FFB74D</color>
<color name="md_orange_400">#FFA726</color>
<color name="md_orange_500">#FF9800</color>
<color name="md_orange_600">#FB8C00</color>
<color name="md_orange_700">#F57C00</color>
<color name="md_orange_800">#EF6C00</color>
<color name="md_orange_900">#E65100</color>
<color name="md_orange_A100">#FFD180</color>
<color name="md_orange_A200">#FFAB40</color>
<color name="md_orange_A400">#FF9100</color>
<color name="md_orange_A700">#FF6D00</color>
<!--deep orange-->
<color name="md_deep_orange_50">#FBE9A7</color>
<color name="md_deep_orange_100">#FFCCBC</color>
<color name="md_deep_orange_200">#FFAB91</color>
<color name="md_deep_orange_300">#FF8A65</color>
<color name="md_deep_orange_400">#FF7043</color>
<color name="md_deep_orange_500">#FF5722</color>
<color name="md_deep_orange_600">#F4511E</color>
<color name="md_deep_orange_700">#E64A19</color>
<color name="md_deep_orange_800">#D84315</color>
<color name="md_deep_orange_900">#BF360C</color>
<color name="md_deep_orange_A100">#FF9E80</color>
<color name="md_deep_orange_A200">#FF6E40</color>
<color name="md_deep_orange_A400">#FF3D00</color>
<color name="md_deep_orange_A700">#DD2600</color>
<!--brown-->
<color name="md_brown_50">#EFEBE9</color>
<color name="md_brown_100">#D7CCC8</color>
<color name="md_brown_200">#BCAAA4</color>
<color name="md_brown_300">#A1887F</color>
<color name="md_brown_400">#8D6E63</color>
<color name="md_brown_500">#795548</color>
<color name="md_brown_600">#6D4C41</color>
<color name="md_brown_700">#5D4037</color>
<color name="md_brown_800">#4E342E</color>
<color name="md_brown_900">#3E2723</color>
<!--grey-->
<color name="md_grey_50">#FAFAFA</color>
<color name="md_grey_100">#F5F5F5</color>
<color name="md_grey_200">#EEEEEE</color>
<color name="md_grey_300">#E0E0E0</color>
<color name="md_grey_400">#BDBDBD</color>
<color name="md_grey_500">#9E9E9E</color>
<color name="md_grey_600">#757575</color>
<color name="md_grey_700">#616161</color>
<color name="md_grey_800">#424242</color>
<color name="md_grey_900">#212121</color>
<color name="md_black_1000">#000000</color>
<color name="md_white_1000">#ffffff</color>
<!--blue_grey-->
<color name="md_blue_grey_50">#ECEFF1</color>
<color name="md_blue_grey_100">#CFD8DC</color>
<color name="md_blue_grey_200">#B0BBC5</color>
<color name="md_blue_grey_300">#90A4AE</color>
<color name="md_blue_grey_400">#78909C</color>
<color name="md_blue_grey_500">#607D8B</color>
<color name="md_blue_grey_600">#546E7A</color>
<color name="md_blue_grey_700">#455A64</color>
<color name="md_blue_grey_800">#37474F</color>
<color name="md_blue_grey_900">#263238</color>
<color name="ufo_blue">#008B9C</color>
<color name="alpha_black">#333333</color>
<color name="alpha_green">#8cd25a</color>
<color name="app_background_color_day">#fafafa</color>
<color name="app_background_color_night">#303030</color>
</resources>

@ -0,0 +1,3 @@
<resources>
<string name="select_color">Select Color</string>
</resources>

@ -0,0 +1,420 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- BASE THEMES -->
<style name="Colorful.Light" parent="Theme.AppCompat.Light.NoActionBar">
<!-- <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>-->
<!-- 状态栏颜色 -->
<item name="colorPrimaryDark">@color/colorPrimary</item>
<!--主要颜色-->
<item name="colorPrimary">@color/colorPrimary</item>
<!--强调颜色-->
<item name="colorAccent">@color/colorPrimary</item>
<item name="colorControlNormal">@color/c_ebebeb</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimary</item>
</style>
<style name="Colorful.Dark" parent="Theme.AppCompat.NoActionBar">
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>
<!-- <style name="primary0">-->
<!-- <item name="colorPrimary">@color/md_red_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_red_700</item>-->
<!-- </style>-->
<!-- <style name="accent0">-->
<!-- <item name="colorAccent">@color/md_red_500</item>-->
<!-- </style>-->
<!-- <style name="primary1">-->
<!-- <item name="colorPrimary">@color/md_pink_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_pink_700</item>-->
<!-- </style>-->
<!-- <style name="accent1">-->
<!-- <item name="colorAccent">@color/md_pink_500</item>-->
<!-- </style>-->
<!-- <style name="primary2">-->
<!-- <item name="colorPrimary">@color/md_purple_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_purple_700</item>-->
<!-- </style>-->
<!-- <style name="accent2">-->
<!-- <item name="colorAccent">@color/md_purple_500</item>-->
<!-- </style>-->
<!-- <style name="primary3">-->
<!-- <item name="colorPrimary">@color/md_deep_purple_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_deep_purple_700</item>-->
<!-- </style>-->
<!-- <style name="accent3">-->
<!-- <item name="colorAccent">@color/md_deep_purple_500</item>-->
<!-- </style>-->
<!-- <style name="primary4">-->
<!-- <item name="colorPrimary">@color/md_indigo_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_indigo_700</item>-->
<!-- </style>-->
<!-- <style name="accent4">-->
<!-- <item name="colorAccent">@color/md_indigo_500</item>-->
<!-- </style>-->
<!-- <style name="primary5">-->
<!-- <item name="colorPrimary">@color/md_blue_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_blue_700</item>-->
<!-- </style>-->
<!-- <style name="accent5">-->
<!-- <item name="colorAccent">@color/md_blue_500</item>-->
<!-- </style>-->
<!-- <style name="primary6">-->
<!-- <item name="colorPrimary">@color/md_light_blue_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_light_blue_700</item>-->
<!-- </style>-->
<!-- <style name="accent6">-->
<!-- <item name="colorAccent">@color/md_light_blue_500</item>-->
<!-- </style>-->
<!-- <style name="primary7">-->
<!-- <item name="colorPrimary">@color/md_cyan_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_cyan_700</item>-->
<!-- </style>-->
<!-- <style name="accent7">-->
<!-- <item name="colorAccent">@color/md_cyan_500</item>-->
<!-- </style>-->
<!-- <style name="primary8">-->
<!-- <item name="colorPrimary">@color/md_teal_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_teal_700</item>-->
<!-- </style>-->
<!-- <style name="accent8">-->
<!-- <item name="colorAccent">@color/md_teal_500</item>-->
<!-- </style>-->
<!-- <style name="primary9">-->
<!-- <item name="colorPrimary">@color/md_green_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_green_700</item>-->
<!-- </style>-->
<!-- <style name="accent9">-->
<!-- <item name="colorAccent">@color/md_green_500</item>-->
<!-- </style>-->
<!-- <style name="primary10">-->
<!-- <item name="colorPrimary">@color/md_light_green_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_light_green_700</item>-->
<!-- </style>-->
<!-- <style name="accent10">-->
<!-- <item name="colorAccent">@color/md_light_green_500</item>-->
<!-- </style>-->
<!-- <style name="primary11">-->
<!-- <item name="colorPrimary">@color/md_lime_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_lime_700</item>-->
<!-- </style>-->
<!-- <style name="accent11">-->
<!-- <item name="colorAccent">@color/md_lime_500</item>-->
<!-- </style>-->
<!-- <style name="primary12">-->
<!-- <item name="colorPrimary">@color/md_yellow_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_yellow_700</item>-->
<!-- </style>-->
<!-- <style name="accent12">-->
<!-- <item name="colorAccent">@color/md_yellow_500</item>-->
<!-- </style>-->
<!-- <style name="primary13">-->
<!-- <item name="colorPrimary">@color/md_amber_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_amber_700</item>-->
<!-- </style>-->
<!-- <style name="accent13">-->
<!-- <item name="colorAccent">@color/md_amber_500</item>-->
<!-- </style>-->
<!-- <style name="primary14">-->
<!-- <item name="colorPrimary">@color/md_orange_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_orange_700</item>-->
<!-- </style>-->
<!-- <style name="accent14">-->
<!-- <item name="colorAccent">@color/md_orange_500</item>-->
<!-- </style>-->
<!-- <style name="primary15">-->
<!-- <item name="colorPrimary">@color/md_deep_orange_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_deep_orange_700</item>-->
<!-- </style>-->
<!-- <style name="accent15">-->
<!-- <item name="colorAccent">@color/md_deep_orange_500</item>-->
<!-- </style>-->
<!-- <style name="primary16">-->
<!-- <item name="colorPrimary">@color/md_brown_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_brown_700</item>-->
<!-- </style>-->
<!-- <style name="accent16">-->
<!-- <item name="colorAccent">@color/md_brown_500</item>-->
<!-- </style>-->
<!-- <style name="primary17">-->
<!-- <item name="colorPrimary">@color/md_grey_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_grey_700</item>-->
<!-- </style>-->
<!-- <style name="accent17">-->
<!-- <item name="colorAccent">@color/md_grey_500</item>-->
<!-- </style>-->
<!-- <style name="primary18">-->
<!-- <item name="colorPrimary">@color/md_blue_grey_500</item>-->
<!-- <item name="colorPrimaryDark">@color/md_blue_grey_700</item>-->
<!-- </style>-->
<!-- <style name="accent18">-->
<!-- <item name="colorAccent">@color/md_blue_grey_500</item>-->
<!-- </style>-->
<!-- <style name="primary19">-->
<!-- <item name="colorPrimary">@color/md_white_1000</item>-->
<!-- <item name="colorPrimaryDark">@color/md_white_1000</item>-->
<!-- </style>-->
<!-- <style name="accent19">-->
<!-- <item name="colorAccent">@color/md_white_1000</item>-->
<!-- </style>-->
<!-- <style name="primary20">-->
<!-- <item name="colorPrimary">@color/md_black_1000</item>-->
<!-- <item name="colorPrimaryDark">@color/md_black_1000</item>-->
<!-- </style>-->
<!-- <style name="accent20">-->
<!-- <item name="colorAccent">@color/md_black_1000</item>-->
<!-- </style>-->
<style name="primary0">
<item name="colorPrimary">@color/md_red_500</item>
<item name="colorPrimaryDark">@color/md_red_500</item>
</style>
<style name="accent0">
<item name="colorAccent">@color/md_red_500</item>
</style>
<style name="primary1">
<item name="colorPrimary">@color/md_pink_500</item>
<item name="colorPrimaryDark">@color/md_pink_500</item>
</style>
<style name="accent1">
<item name="colorAccent">@color/md_pink_500</item>
</style>
<style name="primary2">
<item name="colorPrimary">@color/md_purple_500</item>
<item name="colorPrimaryDark">@color/md_purple_500</item>
</style>
<style name="accent2">
<item name="colorAccent">@color/md_purple_500</item>
</style>
<style name="primary3">
<item name="colorPrimary">@color/md_deep_purple_500</item>
<item name="colorPrimaryDark">@color/md_deep_purple_500</item>
</style>
<style name="accent3">
<item name="colorAccent">@color/md_deep_purple_500</item>
</style>
<style name="primary4">
<item name="colorPrimary">@color/md_indigo_500</item>
<item name="colorPrimaryDark">@color/md_indigo_500</item>
</style>
<style name="accent4">
<item name="colorAccent">@color/md_indigo_500</item>
</style>
<style name="primary5">
<item name="colorPrimary">@color/md_blue_500</item>
<item name="colorPrimaryDark">@color/md_blue_500</item>
</style>
<style name="accent5">
<item name="colorAccent">@color/md_blue_500</item>
</style>
<style name="primary6">
<item name="colorPrimary">@color/md_light_blue_500</item>
<item name="colorPrimaryDark">@color/md_light_blue_500</item>
</style>
<style name="accent6">
<item name="colorAccent">@color/md_light_blue_500</item>
</style>
<style name="primary7">
<item name="colorPrimary">@color/ufo_blue</item>
<item name="colorPrimaryDark">@color/ufo_blue</item>
</style>
<style name="accent7">
<item name="colorAccent">@color/ufo_blue</item>
</style>
<style name="primary8">
<item name="colorPrimary">@color/md_teal_500</item>
<item name="colorPrimaryDark">@color/md_teal_500</item>
</style>
<style name="accent8">
<item name="colorAccent">@color/md_teal_500</item>
</style>
<style name="primary9">
<item name="colorPrimary">@color/md_green_500</item>
<item name="colorPrimaryDark">@color/md_green_500</item>
</style>
<style name="accent9">
<item name="colorAccent">@color/md_green_500</item>
</style>
<style name="primary10">
<item name="colorPrimary">@color/md_light_green_500</item>
<item name="colorPrimaryDark">@color/md_light_green_500</item>
</style>
<style name="accent10">
<item name="colorAccent">@color/md_light_green_500</item>
</style>
<style name="primary11">
<item name="colorPrimary">@color/md_lime_500</item>
<item name="colorPrimaryDark">@color/md_lime_500</item>
</style>
<style name="accent11">
<item name="colorAccent">@color/md_lime_500</item>
</style>
<style name="primary12">
<item name="colorPrimary">@color/md_yellow_500</item>
<item name="colorPrimaryDark">@color/md_yellow_500</item>
</style>
<style name="accent12">
<item name="colorAccent">@color/md_yellow_500</item>
</style>
<style name="primary13">
<item name="colorPrimary">@color/md_amber_500</item>
<item name="colorPrimaryDark">@color/md_amber_500</item>
</style>
<style name="accent13">
<item name="colorAccent">@color/md_amber_500</item>
</style>
<style name="primary14">
<item name="colorPrimary">@color/md_orange_500</item>
<item name="colorPrimaryDark">@color/md_orange_500</item>
</style>
<style name="accent14">
<item name="colorAccent">@color/md_orange_500</item>
</style>
<style name="primary15">
<item name="colorPrimary">@color/md_deep_orange_500</item>
<item name="colorPrimaryDark">@color/md_deep_orange_500</item>
</style>
<style name="accent15">
<item name="colorAccent">@color/md_deep_orange_500</item>
</style>
<style name="primary16">
<item name="colorPrimary">@color/md_brown_500</item>
<item name="colorPrimaryDark">@color/md_brown_500</item>
</style>
<style name="accent16">
<item name="colorAccent">@color/md_brown_500</item>
</style>
<style name="primary17">
<item name="colorPrimary">@color/md_grey_500</item>
<item name="colorPrimaryDark">@color/md_grey_500</item>
</style>
<style name="accent17">
<item name="colorAccent">@color/md_grey_500</item>
</style>
<style name="primary18">
<item name="colorPrimary">@color/md_blue_grey_500</item>
<item name="colorPrimaryDark">@color/md_blue_grey_500</item>
</style>
<style name="accent18">
<item name="colorAccent">@color/md_blue_grey_500</item>
</style>
<style name="primary19">
<item name="colorPrimary">@color/md_white_1000</item>
<item name="colorPrimaryDark">@color/md_white_1000</item>
</style>
<style name="accent19">
<item name="colorAccent">@color/md_white_1000</item>
</style>
<style name="primary20">
<item name="colorPrimary">@color/md_black_1000</item>
<item name="colorPrimaryDark">@color/md_black_1000</item>
</style>
<style name="accent20">
<item name="colorAccent">@color/md_black_1000</item>
</style>
<style name="primary21">
<item name="colorPrimary">@color/alpha_black</item>
<item name="colorPrimaryDark">@color/alpha_black</item>
</style>
<style name="accent21">
<item name="colorAccent">@color/alpha_black</item>
</style>
<style name="primary22">
<item name="colorPrimary">@color/alpha_green</item>
<item name="colorPrimaryDark">@color/alpha_green</item>
</style>
<style name="accent22">
<item name="colorAccent">@color/alpha_green</item>
</style>
</resources>

@ -1 +1,2 @@
include ':app'
include ':colorful'

Loading…
Cancel
Save