paths = bundle.getStringArrayList("paths");
25 | int position = bundle.getInt("position");
26 | ViewPager viewPager = findViewById(R.id.nine_grid_viewPager);
27 | NineGridPreviewAdapter adapter = new NineGridPreviewAdapter(getSupportFragmentManager());
28 | adapter.addAll(paths);
29 | viewPager.setAdapter(adapter);
30 | viewPager.setCurrentItem(position);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/widget/TouchRelativeLayout.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.widget;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 | import android.widget.RelativeLayout;
9 |
10 | public class TouchRelativeLayout extends RelativeLayout implements View.OnTouchListener {
11 | public TouchRelativeLayout(Context context) {
12 | super(context);
13 | setOnTouchListener(this);
14 | }
15 |
16 | public TouchRelativeLayout(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | setOnTouchListener(this);
19 | }
20 |
21 | public TouchRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
22 | super(context, attrs, defStyleAttr);
23 | setOnTouchListener(this);
24 | }
25 |
26 |
27 | @Override
28 | public boolean onTouch(View v, MotionEvent event) {
29 | int action = event.getAction();
30 | if (action==MotionEvent.ACTION_UP || action==MotionEvent.ACTION_CANCEL){
31 | v.setAlpha(1.0f);
32 | v.invalidate();
33 | } else if (action==MotionEvent.ACTION_DOWN){
34 | v.setAlpha(0.7f);
35 | v.invalidate();
36 | }
37 | return false;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
16 |
17 |
18 |
21 |
22 |
25 |
26 |
29 |
30 |
33 |
34 |
37 |
38 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/XHook/XposedCompact.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.XHook;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.view.ContextThemeWrapper;
6 |
7 | import de.robv.android.xposed.XposedBridge;
8 | import me.qiwu.colorqq.BuildConfig;
9 | import me.qiwu.colorqq.R;
10 | import me.qiwu.colorqq.util.QQHelper;
11 |
12 | public class XposedCompact {
13 | public static ClassLoader classLoader;
14 | public static String processName;
15 |
16 | public static Context getModuleContext(Context context){
17 | Context moduleContext = null;
18 | try {
19 | moduleContext = context.createPackageContext(BuildConfig.APPLICATION_ID,Context.CONTEXT_INCLUDE_CODE|Context.CONTEXT_IGNORE_SECURITY);
20 | }catch (Exception e){
21 | XposedBridge.log(e);
22 | }
23 | return moduleContext;
24 | }
25 |
26 | public static Context getModuleContextThemeWrapper(Context context){
27 | Context moduleContext = getModuleContext(context);
28 | if (moduleContext != null){
29 | return new ContextThemeWrapper(moduleContext, R.style.AppTheme);
30 | }
31 | return null;
32 | }
33 |
34 | public static Drawable getModuleDrawable(int id){
35 | return getModuleContext(QQHelper.getContext()).getDrawable(id);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/widget/DrawerHeadItem.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.LinearLayout;
8 | import android.widget.TextView;
9 |
10 | import me.qiwu.colorqq.util.DensityUtil;
11 |
12 | public class DrawerHeadItem extends LinearLayout {
13 | private TextView textView;
14 | public DrawerHeadItem(Context context) {
15 | super(context);
16 | setOrientation(VERTICAL);
17 | View view = new View(context);
18 | view.setBackgroundColor(Color.parseColor("#d8d8d8"));
19 | textView = new TextView(context);
20 | textView.setTextColor(Color.BLACK);
21 | textView.setAlpha(0.8f);
22 | textView.setPadding(DensityUtil.dip2px(context,10),DensityUtil.dip2px(context,5),DensityUtil.dip2px(context,10),DensityUtil.dip2px(context,5));
23 | addView(view,new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,1));
24 | addView(textView);
25 | }
26 |
27 | public void setTitle(CharSequence charSequence){
28 | textView.setText(charSequence);
29 | }
30 |
31 | public void setTitleColor(int color){
32 | textView.setTextColor(color);
33 | }
34 |
35 | public void hideTextView(){
36 | textView.setTextSize(0);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/file_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
21 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/library/cardview/CardViewDelegate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package me.qiwu.colorqq.library.cardview;
17 |
18 | import android.graphics.drawable.Drawable;
19 | import android.view.View;
20 |
21 | /**
22 | * Interface provided by CardView to implementations.
23 | *
24 | * Necessary to resolve circular dependency between base CardView and platform implementations.
25 | */
26 | interface CardViewDelegate {
27 | void setCardBackground(Drawable drawable);
28 | Drawable getCardBackground();
29 | boolean getUseCompatPadding();
30 | boolean getPreventCornerOverlap();
31 | void setShadowPadding(int left, int top, int right, int bottom);
32 | void setMinWidthHeightInternal(int width, int height);
33 | View getCardView();
34 | }
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/library/cardview/CardViewJellybeanMr1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package me.qiwu.colorqq.library.cardview;
17 |
18 | import android.graphics.Canvas;
19 | import android.graphics.Paint;
20 | import android.graphics.RectF;
21 | class CardViewJellybeanMr1 extends CardViewGingerbread {
22 |
23 | @Override
24 | public void initStatic() {
25 | RoundRectDrawableWithShadow.sRoundRectHelper
26 | = new RoundRectDrawableWithShadow.RoundRectHelper() {
27 | @Override
28 | public void drawRoundRect(Canvas canvas, RectF bounds, float cornerRadius,
29 | Paint paint) {
30 | canvas.drawRoundRect(bounds, cornerRadius, cornerRadius, paint);
31 | }
32 | };
33 | }
34 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_theme_color_and_icon_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
17 |
23 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/manager/ActivityManager.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.manager;
2 |
3 | import android.app.Activity;
4 |
5 | import java.lang.ref.WeakReference;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by on 2018/10/18.
11 | */
12 |
13 | public class ActivityManager {
14 | private static ActivityManager sInstance ;
15 | private static List activities =new ArrayList<>();
16 | private WeakReference sCurrentActivityWeakRef;
17 | private ActivityManager() {
18 |
19 | }
20 | public static ActivityManager getInstance() {
21 | if (null == sInstance){
22 | sInstance = new ActivityManager();
23 | }
24 | return sInstance;
25 | }
26 |
27 | public Activity getCurrentActivity() {
28 | Activity currentActivity = null;
29 | if (sCurrentActivityWeakRef != null) {
30 | currentActivity = sCurrentActivityWeakRef.get();
31 | }
32 | return currentActivity;
33 | }
34 |
35 | public void setCurrentActivity(Activity activity) {
36 | sCurrentActivityWeakRef = new WeakReference(activity);
37 | activities.add(activity);
38 | }
39 |
40 | public void removeActivity(Activity activity){
41 | activities.remove(activity);
42 | }
43 |
44 | public void finishAllActivity(){
45 | for (Activity activity : activities){
46 | activity.finish();
47 | }
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_tab_segment.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
24 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_fab_button_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
20 |
27 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/theme/SkinContext.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.theme;
2 |
3 | import android.content.Context;
4 | import android.content.ContextWrapper;
5 | import android.content.SharedPreferences;
6 | import android.content.res.Configuration;
7 | import android.content.res.Resources;
8 | import android.util.DisplayMetrics;
9 |
10 | import androidx.annotation.Nullable;
11 |
12 | import java.util.Map;
13 | import java.util.Set;
14 |
15 | public class SkinContext extends ContextWrapper {
16 | private Resources resources;
17 | public SkinContext(Context base) {
18 | super(base);
19 | Resources resources = base.getResources();
20 | DisplayMetrics displayMetrics = resources.getDisplayMetrics();
21 | DisplayMetrics systemdisplayMetrics = new DisplayMetrics();
22 | systemdisplayMetrics.setTo(displayMetrics);
23 | systemdisplayMetrics.density = displayMetrics.density * 0.7f;
24 | systemdisplayMetrics.scaledDensity = displayMetrics.scaledDensity * 0.7f;
25 | systemdisplayMetrics.densityDpi = (int) (0.7f * ((float)displayMetrics.densityDpi));
26 |
27 | Configuration configuration = new Configuration();
28 | configuration.setTo(resources.getConfiguration());
29 | configuration.densityDpi = (int) (0.7f * ((float)displayMetrics.densityDpi));
30 | this.resources = new Resources(resources.getAssets(),systemdisplayMetrics,configuration);
31 | }
32 |
33 | @Override
34 | public Resources getResources() {
35 | return resources;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/widget/HeaderPreference.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.widget;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.widget.LinearLayout;
9 | import android.widget.TextView;
10 |
11 | import com.google.android.material.card.MaterialCardView;
12 |
13 | import me.qiwu.colorqq.R;
14 |
15 | public class HeaderPreference extends LinearLayout {
16 | private MaterialCardView mCard;
17 | private TextView mTitle;
18 |
19 | public HeaderPreference(Context context) {
20 | this(context,null);
21 | }
22 |
23 | public HeaderPreference(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | View view = LayoutInflater.from(context).inflate(R.layout.widget_header_preference,this);
26 | mCard = view.findViewById(R.id.header_title_card);
27 | mTitle = view.findViewById(R.id.header_title);
28 | setBackgroundColor(context.getColor(R.color.white));
29 | if (attrs!=null){
30 | TypedArray typedArray = context.obtainStyledAttributes(attrs,R.styleable.HeaderPreference);
31 | if (typedArray!=null){
32 | mCard.setCardBackgroundColor(typedArray.getColor(R.styleable.HeaderPreference_header_color,context.getColor(R.color.colorAccent)));
33 | mTitle.setText(typedArray.getString(R.styleable.HeaderPreference_header));
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/annotation/BindView.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.annotation;
2 |
3 | import android.app.Activity;
4 | import android.view.View;
5 |
6 | import java.lang.annotation.ElementType;
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.RetentionPolicy;
9 | import java.lang.annotation.Target;
10 | import java.lang.reflect.Field;
11 |
12 | public class BindView {
13 |
14 | @Target(ElementType.FIELD)
15 | @Retention(RetentionPolicy.RUNTIME)
16 | public @interface ViewResId {
17 | int value();
18 | }
19 |
20 | public static void load(Object obj, View contentParentView) {
21 | Class> cls = obj.getClass(); //获取obj的Class
22 | Field[] fields = cls.getDeclaredFields(); //获取Class中所有的成员
23 | for (Field field : fields) { //遍历所有成员
24 | ViewResId viewResId = field.getAnnotation(ViewResId.class);//获取成员的注解
25 | //判断成员是否含有注解
26 | if (viewResId != null) {
27 | int viewId = viewResId.value(); //获取成员注解的参数,这就是我们传进去控件Id
28 | if (viewId != -1) {
29 | try {
30 | field.setAccessible(true);//取消成员的封装
31 | field.set(obj, contentParentView.findViewById(viewId));//即 field = contentParentView.findViewById(viewId);
32 | } catch (Exception e) {
33 | e.printStackTrace();
34 | }
35 | }
36 | }
37 | }
38 | }
39 |
40 | public static void load(Activity activity){
41 | load(activity,activity.getWindow().getDecorView());
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_file_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
22 |
23 |
33 |
34 |
35 |
36 |
42 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/library/NineGridView/NineGirdPreviewFragment.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.library.NineGridView;
2 |
3 | import android.os.Bundle;
4 | import android.text.TextUtils;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.annotation.Nullable;
12 | import androidx.fragment.app.Fragment;
13 |
14 | import com.squareup.picasso.Picasso;
15 |
16 | import java.io.File;
17 |
18 | import me.qiwu.colorqq.R;
19 |
20 | public class NineGirdPreviewFragment extends Fragment {
21 |
22 | public static NineGirdPreviewFragment newInstance(String path){
23 | NineGirdPreviewFragment fragment = new NineGirdPreviewFragment();
24 | Bundle bundle = new Bundle();
25 | bundle.putString("path",path);
26 | fragment.setArguments(bundle);
27 | return fragment;
28 | }
29 |
30 | @Nullable
31 | @Override
32 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
33 | return inflater.inflate(R.layout.fragment_nine_grid_preview,container,false);
34 | }
35 |
36 | @Override
37 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
38 | super.onViewCreated(view, savedInstanceState);
39 | String path = getArguments().getString("path");
40 | if (TextUtils.isEmpty(path)) return;
41 | ImageView image = view.findViewById(R.id.nine_grid_img);
42 | Picasso.get().load(new File(path)).noFade().into(image);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_arrow_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
16 |
22 |
30 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_color_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
16 |
27 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_file_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
25 |
29 |
32 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_tab_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
21 |
22 |
29 |
30 |
42 |
43 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | defaultConfig {
6 | applicationId "me.qiwu.colorqq2"
7 | minSdkVersion 23
8 | targetSdkVersion 26
9 | versionCode 46
10 | versionName "1.4.2"
11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | compileOptions {
20 | sourceCompatibility JavaVersion.VERSION_1_8
21 | targetCompatibility JavaVersion.VERSION_1_8
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: 'libs', include: ['*.jar'])
27 | compileOnly 'de.robv.android.xposed:api:82'
28 | implementation 'androidx.appcompat:appcompat:1.0.2'
29 | implementation 'com.google.android.material:material:1.0.0'
30 | implementation 'com.scwang.smart:refresh-layout-kernel:2.0.0-alpha-1'
31 | implementation 'com.jaredrummler:colorpicker:1.1.0'
32 | implementation 'com.kyleduo.switchbutton:library:2.0.0'
33 | implementation 'com.squareup.okhttp3:okhttp:3.10.0'
34 | implementation "androidx.palette:palette:1.0.0"
35 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.47-androidx'
36 | implementation 'com.squareup.picasso:picasso:2.71828'
37 | implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.2.8'
38 | implementation 'cat.ereza:customactivityoncrash:2.2.0'
39 | implementation 'com.danikula:videocache:2.7.1'
40 | implementation files('libs/io-zip.jar')
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/hook/QQEditViewHook.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.hook;
2 |
3 | import android.widget.EditText;
4 |
5 | import java.util.HashMap;
6 |
7 | import de.robv.android.xposed.XC_MethodHook;
8 | import de.robv.android.xposed.XposedBridge;
9 | import me.qiwu.colorqq.XHook.XSettingUtils;
10 | import me.qiwu.colorqq.XHook.XUtils;
11 | import me.qiwu.colorqq.util.ClassUtil;
12 |
13 | public class QQEditViewHook implements IHook {
14 | private static QQEditViewHook sInstance;
15 | private static Class> mXEditTextEx;
16 | public static QQEditViewHook getInstance(){
17 | synchronized (QQEditViewHook.class){
18 | if (sInstance == null){
19 | sInstance = new QQEditViewHook();
20 | }
21 | return sInstance;
22 | }
23 | }
24 |
25 |
26 |
27 | @Override
28 | public void startHook() {
29 | if (XSettingUtils.getBoolean("chat_edit_start")){
30 | XposedBridge.hookAllConstructors(mXEditTextEx, new XC_MethodHook() {
31 | @Override
32 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
33 | super.afterHookedMethod(param);
34 | EditText editText = (EditText) param.thisObject;
35 | editText.setHint(XSettingUtils.getString("chat_hint","这是一个提示语"));
36 | editText.setHintTextColor(XSettingUtils.getInt("chat_hint_color",0x66666666));
37 | }
38 | });
39 | }
40 |
41 | }
42 |
43 | @Override
44 | public boolean init() {
45 | mXEditTextEx = XUtils.findClass(ClassUtil.XEditTextEx);
46 | return mXEditTextEx != null;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/widget_switch_preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
17 |
23 |
30 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/widget/MainCardView.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.widget;
2 |
3 | import android.app.AndroidAppHelper;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.content.IntentFilter;
8 |
9 |
10 | import androidx.cardview.widget.CardView;
11 |
12 | import me.qiwu.colorqq.XHook.XSettingUtils;
13 |
14 | public class MainCardView extends CardView {
15 | private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
16 | @Override
17 | public void onReceive(Context context, Intent intent) {
18 | if (intent!=null){
19 | if (intent.getAction().equals("SET_ELEVATION")){
20 | setCardElevation(20f);
21 | } else if (intent.getAction().equals("SET_RADIUS")){
22 | setRadius(Float.valueOf(XSettingUtils.getString("drawer_corner","0")));
23 | }
24 | }
25 | }
26 | };
27 |
28 | public MainCardView(Context context) {
29 | super(context);
30 | }
31 |
32 | @Override
33 | protected void onAttachedToWindow() {
34 | super.onAttachedToWindow();
35 | IntentFilter intentFilter = new IntentFilter();
36 | intentFilter.addAction("SET_ELEVATION");
37 | intentFilter.addAction("SET_RADIUS");
38 | intentFilter.addAction("SET_ELEVATION_AND_RADIUS");
39 | AndroidAppHelper.currentApplication().registerReceiver(broadcastReceiver,intentFilter);
40 | }
41 |
42 | @Override
43 | protected void onDetachedFromWindow() {
44 | super.onDetachedFromWindow();
45 | AndroidAppHelper.currentApplication().unregisterReceiver(broadcastReceiver);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/theme_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
17 |
21 |
28 |
35 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_theme_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
13 |
20 |
31 |
41 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/widget/DrawerMenuItem.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.graphics.drawable.Drawable;
6 | import android.view.LayoutInflater;
7 | import android.view.MotionEvent;
8 | import android.view.View;
9 | import android.widget.ImageView;
10 | import android.widget.LinearLayout;
11 | import android.widget.TextView;
12 |
13 | import me.qiwu.colorqq.R;
14 |
15 | public class DrawerMenuItem extends LinearLayout {
16 | private TextView textView;
17 | private ImageView imageView;
18 | public DrawerMenuItem(Context context) {
19 | super(context);
20 | View view = LayoutInflater.from(context).inflate(R.layout.item_drawer,this);
21 | imageView = view.findViewById(R.id.drawer_item_img);
22 |
23 | textView = view.findViewById(R.id.drawer_item_text);
24 | }
25 |
26 | public void setTitle(CharSequence charSequence){
27 | textView.setText(charSequence);
28 | }
29 |
30 | public void setImg(Drawable drawable){
31 | imageView.setImageDrawable(drawable);
32 | }
33 |
34 | public void setColorFilter(int color){
35 | imageView.setColorFilter(color);
36 | }
37 |
38 | public void setTitleColor(int color){
39 | textView.setTextColor(color);
40 | }
41 |
42 | @Override
43 | public boolean dispatchTouchEvent(MotionEvent event) {
44 | switch (event.getAction()) {
45 | case MotionEvent.ACTION_DOWN:
46 | setAlpha(0.5f);
47 | break;
48 | case MotionEvent.ACTION_CANCEL:
49 | case MotionEvent.ACTION_UP:
50 | setAlpha(1.0f);
51 | break;
52 | default:
53 | break;
54 | }
55 | return super.dispatchTouchEvent(event);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/library/tablayout/utils/FragmentChangeManager.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.library.tablayout.utils;
2 |
3 |
4 |
5 | import androidx.fragment.app.Fragment;
6 | import androidx.fragment.app.FragmentManager;
7 | import androidx.fragment.app.FragmentTransaction;
8 |
9 | import java.util.ArrayList;
10 |
11 | public class FragmentChangeManager {
12 | private FragmentManager mFragmentManager;
13 | private int mContainerViewId;
14 | /** Fragment切换数组 */
15 | private ArrayList mFragments;
16 | /** 当前选中的Tab */
17 | private int mCurrentTab;
18 |
19 | public FragmentChangeManager(FragmentManager fm, int containerViewId, ArrayList fragments) {
20 | this.mFragmentManager = fm;
21 | this.mContainerViewId = containerViewId;
22 | this.mFragments = fragments;
23 | initFragments();
24 | }
25 |
26 | /** 初始化fragments */
27 | private void initFragments() {
28 | for (Fragment fragment : mFragments) {
29 | mFragmentManager.beginTransaction().add(mContainerViewId, fragment).hide(fragment).commit();
30 | }
31 |
32 | setFragments(0);
33 | }
34 |
35 | /** 界面切换控制 */
36 | public void setFragments(int index) {
37 | for (int i = 0; i < mFragments.size(); i++) {
38 | FragmentTransaction ft = mFragmentManager.beginTransaction();
39 | Fragment fragment = mFragments.get(i);
40 | if (i == index) {
41 | ft.show(fragment);
42 | } else {
43 | ft.hide(fragment);
44 | }
45 | ft.commit();
46 | }
47 | mCurrentTab = index;
48 | }
49 |
50 | public int getCurrentTab() {
51 | return mCurrentTab;
52 | }
53 |
54 | public Fragment getCurrentFragment() {
55 | return mFragments.get(mCurrentTab);
56 | }
57 | }
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/activity/CrashActivity.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.activity;
2 |
3 | import android.content.ClipData;
4 | import android.content.ClipboardManager;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.os.Build;
8 | import android.os.Bundle;
9 | import android.view.View;
10 | import android.widget.Button;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 |
14 | import androidx.annotation.Nullable;
15 |
16 | import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
17 | import me.qiwu.colorqq.R;
18 |
19 | public class CrashActivity extends BaseActivity implements View.OnClickListener {
20 | private TextView mCrashTextView;
21 | private TextView mCrashButton;
22 | private String mCrashMsg ;
23 | @Override
24 | protected void onCreate(@Nullable Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_crash);
27 | mCrashTextView = findViewById(R.id.crash_text);
28 | mCrashButton = findViewById(R.id.crash_button);
29 | mCrashButton.setOnClickListener(this);
30 | mCrashMsg = "手机型号:" + Build.BRAND + "-" + Build.MODEL + "\n" +
31 | "系统版本:" + Build.VERSION.RELEASE + "\n" +
32 | "日志:" + CustomActivityOnCrash.getStackTraceFromIntent(getIntent());;
33 | mCrashTextView.setText(mCrashMsg);
34 | }
35 |
36 | @Override
37 | public Context getContext() {
38 | return this;
39 | }
40 |
41 | @Override
42 | public void onClick(View v) {
43 | ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
44 | ClipData mClipData = ClipData.newPlainText("label",mCrashMsg);
45 | cm.setPrimaryClip(mClipData);
46 | Toast.makeText(getContext(),"已复制到剪贴板",Toast.LENGTH_SHORT).show();
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/adapter/ToolPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.adapter;
2 |
3 | import android.view.ViewGroup;
4 |
5 | import androidx.fragment.app.Fragment;
6 | import androidx.fragment.app.FragmentManager;
7 | import androidx.fragment.app.FragmentPagerAdapter;
8 | import androidx.viewpager.widget.PagerAdapter;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by Deng on 2018/10/16.
15 | */
16 |
17 | public class ToolPagerAdapter extends FragmentPagerAdapter {
18 | private ArrayListfragments=new ArrayList<>();
19 | private String[] title ;
20 | private FragmentManager fragmentManager;
21 |
22 | public ToolPagerAdapter(FragmentManager fm, String[] title) {
23 | super(fm);
24 | fragmentManager = fm;
25 | this.title = title;
26 | }
27 |
28 | @Override
29 | public Fragment getItem(int position) {
30 | return fragments.isEmpty()?null:fragments.get(position);
31 | }
32 |
33 | @Override
34 | public int getItemPosition(Object object) {
35 | return PagerAdapter.POSITION_NONE;
36 | }
37 |
38 | @Override
39 | public int getCount() {
40 | return fragments.size();
41 | }
42 |
43 | @Override
44 | public CharSequence getPageTitle(int position) {
45 | return title[position];
46 | }
47 |
48 | public void setFragments(List fragmentArrayList){
49 | fragments.clear();
50 | fragments.addAll(fragmentArrayList);
51 | notifyDataSetChanged();
52 | }
53 |
54 | @Override
55 | public Object instantiateItem(ViewGroup container, int position) {
56 | Fragment fragment = (Fragment) super.instantiateItem(container, position);
57 | fragmentManager.beginTransaction().show(fragment).commit();
58 | return fragment;
59 | }
60 |
61 |
62 |
63 |
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/theme/SkinTitleBar.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.theme;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.View;
7 |
8 | import androidx.annotation.Nullable;
9 |
10 | import java.io.File;
11 | import java.io.FileInputStream;
12 |
13 | public class SkinTitleBar extends View implements ISkinWidget {
14 | private long lastModified;
15 | public SkinTitleBar(Context context) {
16 | super(context);
17 | loadSkin();
18 | }
19 |
20 | public SkinTitleBar(Context context, @Nullable AttributeSet attrs) {
21 | super(context, attrs);
22 | loadSkin();
23 | }
24 |
25 | public SkinTitleBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
26 | super(context, attrs, defStyleAttr);
27 | loadSkin();
28 | }
29 |
30 | @Override
31 | public int getType() {
32 | return ISkinWidget.TYPE_COLOR;
33 | }
34 |
35 | @Override
36 | public String getSkinName() {
37 | Object tag = getTag();
38 | return tag == null ? null : (tag.toString() + ".xml");
39 | }
40 |
41 | @Override
42 | public void loadSkin() {
43 | if (BaseConstantState.THEME_PATH != null && getSkinName() != null){
44 | File file = new File(BaseConstantState.THEME_PATH + "/color/" + getSkinName());
45 | if (file.exists()){
46 | try {
47 | if (file.lastModified() == lastModified)return;
48 | lastModified = file.lastModified();
49 | setBackgroundColor(SkinnableColorStateList.createFromFile(getResources(),new FileInputStream(file)).getDefaultColor());
50 | } catch (Throwable e) {
51 | e.printStackTrace();
52 | }
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/activity/CreateDic.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.activity;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class CreateDic {
7 | private int BitNum;
8 | private String Str;
9 | public void setBitNum(int num) {
10 | BitNum=num;
11 | }
12 |
13 | public void setStr(String str) {
14 | Str=str;
15 | }
16 |
17 | public int getBitNum(){
18 | return BitNum;
19 | }
20 |
21 | public String getStr(){
22 | return Str;
23 | }
24 |
25 | public List getDic(){
26 | int[] tmparray=new int[BitNum];
27 | List final_list=new ArrayList();
28 | String result="";
29 | for(int i=0;i=0;j--) {
42 | if(tmparray[j]==length-1){
43 | if(j!=0){
44 | continue;
45 | }
46 | else{
47 | mark=1;
48 | break;
49 | }
50 | }
51 | else{
52 | tmparray[j]++;
53 | for(int k=j+1;k
2 |
8 |
12 |
18 |
22 |
28 |
29 |
41 |
--------------------------------------------------------------------------------
/app/src/main/java/me/qiwu/colorqq/library/NineGridView/NineGridImageView.java:
--------------------------------------------------------------------------------
1 | package me.qiwu.colorqq.library.NineGridView;
2 |
3 | import android.content.Context;
4 | import android.graphics.Outline;
5 | import android.util.AttributeSet;
6 | import android.view.MotionEvent;
7 | import android.view.View;
8 | import android.view.ViewOutlineProvider;
9 | import android.widget.ImageView;
10 |
11 | import androidx.appcompat.widget.AppCompatImageView;
12 |
13 | import com.scwang.smart.refresh.layout.util.DesignUtil;
14 |
15 | import me.qiwu.colorqq.library.RCLayout.RCImageView;
16 | import me.qiwu.colorqq.util.DensityUtil;
17 |
18 | /**
19 | * ImageView which has click effect
20 | */
21 | public class NineGridImageView extends AppCompatImageView {
22 | public NineGridImageView(Context context) {
23 | super(context);
24 | init();
25 | }
26 |
27 | public NineGridImageView(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 | init();
30 | }
31 |
32 | private void init(){
33 | setClickable(true);
34 | setScaleType(ScaleType.CENTER_CROP);
35 | setOutlineProvider(new ViewOutlineProvider() {
36 | @Override
37 | public void getOutline(View view, Outline outline) {
38 | outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), DensityUtil.dip2px(getContext(),10));
39 | }
40 | });
41 | setClipToOutline(true);
42 | }
43 |
44 | @Override
45 | public boolean dispatchTouchEvent(MotionEvent event) {
46 | switch (event.getAction()) {
47 | case MotionEvent.ACTION_DOWN:
48 | setAlpha(0.7f);
49 | break;
50 | case MotionEvent.ACTION_CANCEL:
51 | case MotionEvent.ACTION_UP:
52 | setAlpha(1.0f);
53 | break;
54 | default:
55 | break;
56 | }
57 | return super.dispatchTouchEvent(event);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------