mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-11 06:44:00 +00:00
Fix Talkback wrong label announced going from App to Overview
To fix the incorrect title information being spoken after a transition state ends, a new function named getTitle is introduced in the LauncherState. This function provides the correct title for the transition state. The default accessibility label is set to R.string.home_screen. All Apps and Overview states override the getTitle function to ensure the correct accessibility label for their respective states. Fix: 265892510 Flag: EXEMPT bugfix Test: Manual with Talkback. With Talkback enabled, navigate from App to Overview. Change-Id: I96b820f310f8b778a149709bca687a5912386246
This commit is contained in:
@@ -101,6 +101,11 @@ public class AllAppsState extends LauncherState {
|
|||||||
return launcher.getAppsView().getDescription();
|
return launcher.getAppsView().getDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTitle() {
|
||||||
|
return R.string.all_apps_label;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getVerticalProgress(Launcher launcher) {
|
public float getVerticalProgress(Launcher launcher) {
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|||||||
@@ -182,6 +182,11 @@ public class OverviewState extends LauncherState {
|
|||||||
return launcher.getString(R.string.accessibility_recent_apps);
|
return launcher.getString(R.string.accessibility_recent_apps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTitle() {
|
||||||
|
return R.string.accessibility_recent_apps;
|
||||||
|
}
|
||||||
|
|
||||||
public static float getDefaultSwipeHeight(Launcher launcher) {
|
public static float getDefaultSwipeHeight(Launcher launcher) {
|
||||||
return LayoutUtils.getDefaultSwipeHeight(launcher, launcher.getDeviceProfile());
|
return LayoutUtils.getDefaultSwipeHeight(launcher, launcher.getDeviceProfile());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -371,6 +371,9 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
|
|||||||
getSystemUiController().updateUiState(SystemUiController.UI_STATE_BASE_WINDOW,
|
getSystemUiController().updateUiState(SystemUiController.UI_STATE_BASE_WINDOW,
|
||||||
Themes.getAttrBoolean(this, R.attr.isWorkspaceDarkText));
|
Themes.getAttrBoolean(this, R.attr.isWorkspaceDarkText));
|
||||||
ACTIVITY_TRACKER.handleCreate(this);
|
ACTIVITY_TRACKER.handleCreate(this);
|
||||||
|
|
||||||
|
// Set screen title for Talkback
|
||||||
|
setTitle(R.string.accessibility_recent_apps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1268,11 +1268,7 @@ public class Launcher extends StatefulActivity<LauncherState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set screen title for Talkback
|
// Set screen title for Talkback
|
||||||
if (state == ALL_APPS) {
|
setTitle(state.getTitle());
|
||||||
setTitle(R.string.all_apps_label);
|
|
||||||
} else {
|
|
||||||
setTitle(R.string.home_screen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import android.view.View;
|
|||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
import androidx.annotation.FloatRange;
|
import androidx.annotation.FloatRange;
|
||||||
|
import androidx.annotation.StringRes;
|
||||||
|
|
||||||
import com.android.launcher3.statemanager.BaseState;
|
import com.android.launcher3.statemanager.BaseState;
|
||||||
import com.android.launcher3.statemanager.StateManager;
|
import com.android.launcher3.statemanager.StateManager;
|
||||||
@@ -369,6 +370,10 @@ public abstract class LauncherState implements BaseState<LauncherState> {
|
|||||||
return launcher.getWorkspace().getCurrentPageDescription();
|
return launcher.getWorkspace().getCurrentPageDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @StringRes int getTitle() {
|
||||||
|
return R.string.home_screen;
|
||||||
|
}
|
||||||
|
|
||||||
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
|
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
|
||||||
if ((this != NORMAL && this != HINT_STATE)
|
if ((this != NORMAL && this != HINT_STATE)
|
||||||
|| !launcher.getDeviceProfile().shouldFadeAdjacentWorkspaceScreens()) {
|
|| !launcher.getDeviceProfile().shouldFadeAdjacentWorkspaceScreens()) {
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ public class AllAppsState extends LauncherState {
|
|||||||
return launcher.getString(R.string.all_apps_button_label);
|
return launcher.getString(R.string.all_apps_button_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getTitle() {
|
||||||
|
return R.string.all_apps_label;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getVisibleElements(Launcher launcher) {
|
public int getVisibleElements(Launcher launcher) {
|
||||||
return ALL_APPS_CONTENT;
|
return ALL_APPS_CONTENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user