diff options
author | Live Channels Team <no-reply@google.com> | 2018-01-22 16:53:16 -0800 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2018-01-23 15:54:51 +0000 |
commit | a1589bd48e05abbee991e0cdd27fa402a5dc5001 (patch) | |
tree | dc016fe932e3b6104b468f7b83025b8baf5e26c6 /src/com/android/tv/onboarding | |
parent | 4885245cec64d3ef82e502d69ed873fa0760b5fb (diff) | |
download | TV-a1589bd48e05abbee991e0cdd27fa402a5dc5001.tar.gz |
Set the target sdk to 26.
Use AtomicInteger instead of volatile.
Create BASE_PACKAGE to explicitly handle the com.android.tv package
which is different than the Live Channels package name com.google.android.tv
Project import generated by Copybara.
PiperOrigin-RevId: 182859017
Change-Id: Ie4bcd0973848f235a40db0586f9a2dcca1198a21
Diffstat (limited to 'src/com/android/tv/onboarding')
-rw-r--r-- | src/com/android/tv/onboarding/NewSourcesFragment.java | 3 | ||||
-rw-r--r-- | src/com/android/tv/onboarding/SetupSourcesFragment.java | 3 | ||||
-rw-r--r-- | src/com/android/tv/onboarding/WelcomeFragment.java | 133 |
3 files changed, 73 insertions, 66 deletions
diff --git a/src/com/android/tv/onboarding/NewSourcesFragment.java b/src/com/android/tv/onboarding/NewSourcesFragment.java index e6b247a0..f3b077a7 100644 --- a/src/com/android/tv/onboarding/NewSourcesFragment.java +++ b/src/com/android/tv/onboarding/NewSourcesFragment.java @@ -30,8 +30,7 @@ import com.android.tv.common.ui.setup.SetupActionHelper; /** A fragment for new channel source info/setup. */ public class NewSourcesFragment extends Fragment { /** The action category. */ - public static final String ACTION_CATEOGRY = - "com.android.tv.onboarding.NewSourcesFragment"; + public static final String ACTION_CATEOGRY = "com.android.tv.onboarding.NewSourcesFragment"; /** An action to show the setup screen. */ public static final int ACTION_SETUP = 1; /** An action to close this fragment. */ diff --git a/src/com/android/tv/onboarding/SetupSourcesFragment.java b/src/com/android/tv/onboarding/SetupSourcesFragment.java index 3025538b..974caf3f 100644 --- a/src/com/android/tv/onboarding/SetupSourcesFragment.java +++ b/src/com/android/tv/onboarding/SetupSourcesFragment.java @@ -46,8 +46,7 @@ import java.util.List; /** A fragment for channel source info/setup. */ public class SetupSourcesFragment extends SetupMultiPaneFragment { /** The action category for the actions which is fired from this fragment. */ - public static final String ACTION_CATEGORY = - "com.android.tv.onboarding.SetupSourcesFragment"; + public static final String ACTION_CATEGORY = "com.android.tv..onboarding.SetupSourcesFragment"; /** An action to open the merchant collection. */ public static final int ACTION_ONLINE_STORE = 1; /** diff --git a/src/com/android/tv/onboarding/WelcomeFragment.java b/src/com/android/tv/onboarding/WelcomeFragment.java index 92b56e8d..8c119a8a 100644 --- a/src/com/android/tv/onboarding/WelcomeFragment.java +++ b/src/com/android/tv/onboarding/WelcomeFragment.java @@ -614,6 +614,7 @@ public class WelcomeFragment extends OnboardingFragment { mPageDescriptions = getResources().getStringArray(R.array.welcome_page_descriptions); } } + @Nullable @Override public View onCreateView( @@ -624,74 +625,82 @@ public class WelcomeFragment extends OnboardingFragment { mPagingIndicator = view.findViewById(android.support.v17.leanback.R.id.page_indicator); mStartButton = view.findViewById(android.support.v17.leanback.R.id.button_start); - mStartButton.setAccessibilityDelegate(new AccessibilityDelegate() { - @Override - public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) { - int type = event.getEventType(); - if (type == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED - || type == AccessibilityEvent.TYPE_VIEW_FOCUSED) { - if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { - // Skip the event before the title is accessibility focused to avoid race - // conditions - return; + mStartButton.setAccessibilityDelegate( + new AccessibilityDelegate() { + @Override + public void onInitializeAccessibilityEvent( + View host, AccessibilityEvent event) { + int type = event.getEventType(); + if (type == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED + || type == AccessibilityEvent.TYPE_VIEW_FOCUSED) { + if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { + // Skip the event before the title is accessibility focused to avoid + // race + // conditions + return; + } + } + super.onInitializeAccessibilityEvent(host, event); } - } - super.onInitializeAccessibilityEvent(host, event); - } - }); - - mPagingIndicator.setAccessibilityDelegate(new AccessibilityDelegate() { - @Override - public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) { - int type = event.getEventType(); - if (type == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED - || type == AccessibilityEvent.TYPE_VIEW_FOCUSED) { - if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { - // Skip the event before the title is accessibility focused to avoid race - // conditions - return; + }); + + mPagingIndicator.setAccessibilityDelegate( + new AccessibilityDelegate() { + @Override + public void onInitializeAccessibilityEvent( + View host, AccessibilityEvent event) { + int type = event.getEventType(); + if (type == AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED + || type == AccessibilityEvent.TYPE_VIEW_FOCUSED) { + if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { + // Skip the event before the title is accessibility focused to avoid + // race + // conditions + return; + } + } + super.onInitializeAccessibilityEvent(host, event); } - } - super.onInitializeAccessibilityEvent(host, event); - } - }); - - mTitleView.setAccessibilityDelegate(new AccessibilityDelegate() { - @Override - public boolean performAccessibilityAction(View host, int action, Bundle args) { - if (action == ACTION_CLEAR_ACCESSIBILITY_FOCUS) { - if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { - // Skip the event before the title is accessibility focused to avoid race - // conditions - return false; + }); + + mTitleView.setAccessibilityDelegate( + new AccessibilityDelegate() { + @Override + public boolean performAccessibilityAction(View host, int action, Bundle args) { + if (action == ACTION_CLEAR_ACCESSIBILITY_FOCUS) { + if (!mTitleChanged || mTitleView.isAccessibilityFocused()) { + // Skip the event before the title is accessibility focused to avoid + // race + // conditions + return false; + } + } + return super.performAccessibilityAction(host, action, args); } - } - return super.performAccessibilityAction(host, action, args); - } - }); + }); - mTitleView.addTextChangedListener(new TextWatcher() { - @Override - public void beforeTextChanged(CharSequence s, int start, int count, int after) { - mTitleChanged = false; - } + mTitleView.addTextChangedListener( + new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + mTitleChanged = false; + } - @Override - public void onTextChanged(CharSequence s, int start, int before, int count) { - } + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) {} - @Override - public void afterTextChanged(Editable s) { - if (!mTitleView.isAccessibilityFocused()) { - mTitleView.performAccessibilityAction( - AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); - } else { - mTitleView.sendAccessibilityEvent( - AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); - } - mTitleChanged = true; - } - }); + @Override + public void afterTextChanged(Editable s) { + if (!mTitleView.isAccessibilityFocused()) { + mTitleView.performAccessibilityAction( + AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null); + } else { + mTitleView.sendAccessibilityEvent( + AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); + } + mTitleChanged = true; + } + }); return view; } |