Skip to content

Commit

Permalink
Get rid of AppCompatActivity (#68)
Browse files Browse the repository at this point in the history
* Revert "Call super's onActivityResult (#37)"

This reverts commit 70bd4f4.

* Revert "Use AppCompat theme on AddItemActivity (#32)"

This reverts commit 26566fd.

* Revert "More AndroidX fragments (#20)"

This reverts commit 6dbf0c0.

* Migrate to ComponentActivity

* Revert "Migrate BaseActivity to AppCompat (#5)"

This reverts commit 0a9f1a8

* Remove androidx.appcompat:appcompat

* Restore BaseLauncherTheme

* Fix style
  • Loading branch information
Goooler authored Sep 12, 2024
1 parent fe02dd5 commit e55ba37
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 23 deletions.
10 changes: 0 additions & 10 deletions lawnchair/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,4 @@
<item name="android:enforceNavigationBarContrast">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="Theme.AppCompat.Translucent.NoTitleBar" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<!-- Note that we use the base animation style here (that is no
animations) because we really have no idea how this kind of
activity will be used. -->
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion lawnchair/src/app/lawnchair/nexuslauncher/SmartspaceQsb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SmartspaceQsb @JvmOverloads constructor(context: Context, attrs: Attribute

override fun createBindOptions(): Bundle {
val opts = super.createBindOptions()
opts.putString("attached-launcher-identifier", requireContext().packageName)
opts.putString("attached-launcher-identifier", context.packageName)
opts.putBoolean("com.google.android.apps.gsa.widget.PREINSTALLED", true)
return opts
}
Expand Down
2 changes: 1 addition & 1 deletion res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-->

<resources>
<style name="AddItemActivityTheme" parent="Theme.AppCompat.Translucent.NoTitleBar">
<style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
Expand Down
2 changes: 1 addition & 1 deletion res/values-v29/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<resources>
<!-- Launcher theme -->
<style name="BaseLauncherTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="BaseLauncherTheme" parent="@android:style/Theme.Material.Light">
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:colorEdgeEffect">#FF757575</item>
<item name="android:windowActionBar">false</item>
Expand Down
2 changes: 1 addition & 1 deletion res/values-v30/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<resources>
<!-- Launcher theme -->
<style name="BaseLauncherTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="BaseLauncherTheme" parent="@android:style/Theme.Material.Light">
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:colorEdgeEffect">#FF757575</item>
<item name="android:windowActionBar">false</item>
Expand Down
4 changes: 2 additions & 2 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<resources>
<!-- Launcher theme -->
<style name="BaseLauncherTheme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="BaseLauncherTheme" parent="@android:style/Theme.DeviceDefault.Light">
<item name="disabledIconAlpha">.54</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:colorEdgeEffect">#FF757575</item>
Expand Down Expand Up @@ -406,7 +406,7 @@
<item name="android:stateListAnimator">@null</item>
</style>

<style name="AddItemActivityTheme" parent="Theme.AppCompat.Translucent.NoTitleBar">
<style name="AddItemActivityTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="widgetsTheme">@style/WidgetContainerTheme</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowTranslucentStatus">true</item>
Expand Down
4 changes: 2 additions & 2 deletions src/com/android/launcher3/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
import android.view.View;
import android.window.OnBackInvokedDispatcher;

import androidx.activity.ComponentActivity;
import androidx.annotation.IntDef;
import androidx.appcompat.app.AppCompatActivity;

import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.logging.StatsLogManager;
Expand All @@ -53,7 +53,7 @@
/**
* Launcher BaseActivity
*/
public abstract class BaseActivity extends AppCompatActivity implements ActivityContext {
public abstract class BaseActivity extends ComponentActivity implements ActivityContext {

private static final String TAG = "BaseActivity";
static final boolean DEBUG = false;
Expand Down
1 change: 0 additions & 1 deletion src/com/android/launcher3/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,6 @@ public void run() {
@Override
public void onActivityResult(
final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
mPendingActivityRequestCode = -1;
handleActivityResult(requestCode, resultCode, data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.android.launcher3.graphics;

import androidx.fragment.app.Fragment;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static com.android.launcher3.model.ModelUtils.getMissingHotseatRanks;

import android.annotation.TargetApi;
import androidx.fragment.app.Fragment;
import android.app.Fragment;
import android.app.WallpaperColors;
import android.app.WallpaperManager;
import android.appwidget.AppWidgetHost;
Expand Down
2 changes: 1 addition & 1 deletion src/com/android/launcher3/qsb/QsbContainerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_PROVIDER;

import android.app.Activity;
import androidx.fragment.app.Fragment;
import android.app.Fragment;
import android.app.SearchManager;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetHostView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package com.android.systemui.plugins;

import androidx.fragment.app.Fragment;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
Expand Down

0 comments on commit e55ba37

Please sign in to comment.