Skip to content

Commit

Permalink
优化项目结构
Browse files Browse the repository at this point in the history
合并小爱同学设置页
  • Loading branch information
Fan095 committed May 23, 2024
1 parent 21d46c2 commit 0b3e57b
Show file tree
Hide file tree
Showing 160 changed files with 492 additions and 729 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</activity-alias>

<activity
android:name=".ui.fragment.settings.SubSettings"
android:name=".ui.settings.SubSettings"
android:exported="true"
tools:ignore="DiscouragedApi,LockedOrientationActivity">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import com.sevtinge.hyperceiler.callback.IEditCallback;
import com.sevtinge.hyperceiler.data.AppData;
import com.sevtinge.hyperceiler.ui.fragment.sub.AppPicker;
import com.sevtinge.hyperceiler.ui.sub.AppPicker;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import androidx.annotation.Nullable;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.fragment.settings.SubSettings;
import com.sevtinge.hyperceiler.ui.settings.SubSettings;
import com.sevtinge.hyperceiler.utils.SettingLauncherHelper;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.callback.IResult;
import com.sevtinge.hyperceiler.ui.navigator.ContentFragment;
import com.sevtinge.hyperceiler.ui.fragment.settings.adapter.PreferenceHeader;
import com.sevtinge.hyperceiler.ui.fragment.settings.core.SubSettingLauncher;
import com.sevtinge.hyperceiler.ui.fragment.settings.utils.SettingsFeatures;
import com.sevtinge.hyperceiler.ui.settings.adapter.PreferenceHeader;
import com.sevtinge.hyperceiler.ui.settings.core.SubSettingLauncher;
import com.sevtinge.hyperceiler.ui.settings.utils.SettingsFeatures;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

import java.util.List;

Expand Down Expand Up @@ -47,6 +48,7 @@ public void checkTheme() {
protected void onCreate(Bundle savedInstanceState) {
checkTheme();
super.onCreate(savedInstanceState);
PrefsUtils.registerSharedPrefsObserver(this);
initializeViews(savedInstanceState);
hideActionBar();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
*/
package com.sevtinge.hyperceiler.ui;

import android.content.Intent;

import com.sevtinge.hyperceiler.callback.IAppSelectCallback;
import com.sevtinge.hyperceiler.ui.fragment.settings.SettingsActivity;
import com.sevtinge.hyperceiler.ui.fragment.sub.AppPicker;
import com.sevtinge.hyperceiler.ui.settings.SettingsActivity;
import com.sevtinge.hyperceiler.ui.sub.AppPicker;

public class SubPickerActivity extends SettingsActivity {
AppPicker mAppSelectFragment = new AppPicker();
Expand Down
103 changes: 0 additions & 103 deletions app/src/main/java/com/sevtinge/hyperceiler/ui/base/BaseActivity.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sevtinge.hyperceiler.ui.fragment.settings.dashboard;
package com.sevtinge.hyperceiler.ui.dashboard;

import android.app.Activity;
import android.content.ContentResolver;
Expand All @@ -13,10 +13,10 @@
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;

import com.sevtinge.hyperceiler.ui.fragment.settings.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.ui.fragment.settings.core.AbstractPreferenceController;
import com.sevtinge.hyperceiler.ui.fragment.settings.core.BasePreferenceController;
import com.sevtinge.hyperceiler.ui.fragment.settings.core.PreferenceControllerListHelper;
import com.sevtinge.hyperceiler.ui.settings.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.ui.settings.core.AbstractPreferenceController;
import com.sevtinge.hyperceiler.ui.settings.core.BasePreferenceController;
import com.sevtinge.hyperceiler.ui.settings.core.PreferenceControllerListHelper;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -95,8 +95,11 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
// Give all controllers a chance to handle click.
//preference.getExtras().putInt(CATEGORY, getMetricsCategory());
});
initPrefs();
}

public void initPrefs() {}

@Override
public void onResume() {
super.onResume();
Expand Down Expand Up @@ -174,7 +177,9 @@ protected void addPreferenceController(AbstractPreferenceController controller)
/**
* Get the tag string for logging.
*/
protected abstract String getLogTag();
protected String getLogTag() {
return getClass().getSimpleName();
}

/**
* Get a list of {@link AbstractPreferenceController} for this fragment.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.sevtinge.hyperceiler.ui.fragment.settings.dashboard;
package com.sevtinge.hyperceiler.ui.dashboard;

import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;

import com.sevtinge.hyperceiler.ui.fragment.settings.utils.ThreadUtils;
import com.sevtinge.hyperceiler.ui.settings.utils.ThreadUtils;

import java.util.concurrent.CountDownLatch;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@
import androidx.annotation.Nullable;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.fragment.settings.SubSettings;
import com.sevtinge.hyperceiler.ui.settings.SubSettings;
import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;
import com.sevtinge.hyperceiler.utils.shell.ShellInit;

import java.util.ArrayList;

import fan.appcompat.app.AlertDialog;
import fan.preference.PreferenceFragment;

public abstract class SettingsPreferenceFragment extends BasePreferenceFragment {
public abstract class SettingsPreferenceFragment extends PreferenceFragment {

public final String TAG = getClass().getSimpleName();
public MenuItem mRestartMenu;
Expand All @@ -68,16 +69,13 @@ public void onCreate(Bundle savedInstanceState) {

@Override
public void onCreatePreferences(Bundle bundle, String s) {
super.onCreatePreferences(bundle, s);
Bundle args = getArguments();
if (args != null) {
mTitle = args.getString(":fragment:show_title");
mTitleResId = args.getInt(":fragment:show_title_resid");
mPreferenceKey = args.getString(":settings:fragment_args_key");
mContentResId = args.getInt("contentResId");
}
if (mTitleResId != 0) setTitle(mTitleResId);
if (!TextUtils.isEmpty(mTitle)) setTitle(mTitle);
mContentResId = mContentResId != 0 ? mContentResId : getContentResId();
if (mContentResId > 0) {
setPreferencesFromResource(mContentResId, s);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0b3e57b

Please sign in to comment.