List of usage examples for android.text TextUtils equals
public static boolean equals(CharSequence a, CharSequence b)
From source file:com.dudu.aios.ui.activity.MainRecordActivity.java
@Override public boolean dispatchKeyEvent(KeyEvent event) { if (TextUtils.equals(FragmentConstants.BT_IN_CALL, currentStackTag)) { List<BaseManagerFragment> fragmentList = fragmentMap.get(FragmentConstants.BT_IN_CALL); ((BtInCallFragment) fragmentList.get(fragmentList.size() - 1)).dispatchKeyEvent(event); } else if (TextUtils.equals(FragmentConstants.BT_CALLING, currentStackTag)) { List<BaseManagerFragment> fragmentList = fragmentMap.get(FragmentConstants.BT_CALLING); ((BtCallingFragment) fragmentList.get(fragmentList.size() - 1)).dispatchKeyEvent(event); }//from ww w . ja va 2 s . c om return super.dispatchKeyEvent(event); }
From source file:im.neon.activity.LoginActivity.java
/** * Check if the home server url has been updated * * @return true if the HS url has been updated *//*from www . ja v a2s . c o m*/ private boolean onHomeServerUrlUpdate() { if (!TextUtils.equals(mHomeServerUrl, getHomeServerUrl())) { mHomeServerUrl = getHomeServerUrl(); mRegistrationResponse = null; // invalidate the current homeserver config mHomeserverConnectionConfig = null; // the account creation is not always supported so ensure that the dedicated button is always displayed. mRegisterButton.setVisibility(View.VISIBLE); checkFlows(); return true; } return false; }
From source file:com.taobao.weex.WXSDKInstance.java
private String wrapPageName(String pageName, String url) { if (TextUtils.equals(pageName, WXPerformance.DEFAULT)) { pageName = url;/* w w w . j ava 2 s. co m*/ WXExceptionUtils.degradeUrl = pageName; try { Uri uri = Uri.parse(url); if (uri != null) { Uri.Builder builder = new Uri.Builder(); builder.scheme(uri.getScheme()); builder.authority(uri.getAuthority()); builder.path(uri.getPath()); pageName = builder.toString(); } } catch (Exception e) { } } return pageName; }
From source file:com.android.mail.compose.ComposeActivity.java
private void finishCreate() { final Bundle savedState = mInnerSavedState; findViews();/*from w w w .j ava2s. c o m*/ final Intent intent = getIntent(); final Message message; final ArrayList<AttachmentPreview> previews; mShowQuotedText = false; final CharSequence quotedText; int action; // Check for any of the possibly supplied accounts.; final Account account; if (hadSavedInstanceStateMessage(savedState)) { action = savedState.getInt(EXTRA_ACTION, COMPOSE); account = savedState.getParcelable(Utils.EXTRA_ACCOUNT); message = savedState.getParcelable(EXTRA_MESSAGE); previews = savedState.getParcelableArrayList(EXTRA_ATTACHMENT_PREVIEWS); mRefMessage = savedState.getParcelable(EXTRA_IN_REFERENCE_TO_MESSAGE); quotedText = savedState.getCharSequence(EXTRA_QUOTED_TEXT); mExtraValues = savedState.getParcelable(EXTRA_VALUES); // Get the draft id from the request id if there is one. if (savedState.containsKey(EXTRA_REQUEST_ID)) { final int requestId = savedState.getInt(EXTRA_REQUEST_ID); if (sRequestMessageIdMap.containsKey(requestId)) { synchronized (mDraftLock) { mDraftId = sRequestMessageIdMap.get(requestId); } } } } else { account = obtainAccount(intent); action = intent.getIntExtra(EXTRA_ACTION, COMPOSE); // Initialize the message from the message in the intent message = intent.getParcelableExtra(ORIGINAL_DRAFT_MESSAGE); previews = intent.getParcelableArrayListExtra(EXTRA_ATTACHMENT_PREVIEWS); mRefMessage = intent.getParcelableExtra(EXTRA_IN_REFERENCE_TO_MESSAGE); mRefMessageUri = intent.getParcelableExtra(EXTRA_IN_REFERENCE_TO_MESSAGE_URI); quotedText = null; if (Analytics.isLoggable()) { if (intent.getBooleanExtra(Utils.EXTRA_FROM_NOTIFICATION, false)) { Analytics.getInstance().sendEvent("notification_action", "compose", getActionString(action), 0); } } } mAttachmentsView.setAttachmentPreviews(previews); setAccount(account); if (mAccount == null) { return; } initRecipients(); // Clear the notification and mark the conversation as seen, if necessary final Folder notificationFolder = intent.getParcelableExtra(EXTRA_NOTIFICATION_FOLDER); if (notificationFolder != null) { final Uri conversationUri = intent.getParcelableExtra(EXTRA_NOTIFICATION_CONVERSATION); Intent actionIntent; if (conversationUri != null) { actionIntent = new Intent(MailIntentService.ACTION_RESEND_NOTIFICATIONS_WEAR); actionIntent.putExtra(Utils.EXTRA_CONVERSATION, conversationUri); } else { actionIntent = new Intent(MailIntentService.ACTION_CLEAR_NEW_MAIL_NOTIFICATIONS); actionIntent.setData(Utils.appendVersionQueryParameter(this, notificationFolder.folderUri.fullUri)); } actionIntent.setPackage(getPackageName()); actionIntent.putExtra(Utils.EXTRA_ACCOUNT, account); actionIntent.putExtra(Utils.EXTRA_FOLDER, notificationFolder); startService(actionIntent); } if (intent.getBooleanExtra(EXTRA_FROM_EMAIL_TASK, false)) { mLaunchedFromEmail = true; } else if (Intent.ACTION_SEND.equals(intent.getAction())) { final Uri dataUri = intent.getData(); if (dataUri != null) { final String dataScheme = intent.getData().getScheme(); final String accountScheme = mAccount.composeIntentUri.getScheme(); mLaunchedFromEmail = TextUtils.equals(dataScheme, accountScheme); } } if (mRefMessageUri != null) { mShowQuotedText = true; mComposeMode = action; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); String wearReply = null; if (remoteInput != null) { LogUtils.d(LOG_TAG, "Got remote input from new api"); CharSequence input = remoteInput.getCharSequence(NotificationActionUtils.WEAR_REPLY_INPUT); if (input != null) { wearReply = input.toString(); } } else { // TODO: remove after legacy code has been removed. LogUtils.d(LOG_TAG, "No remote input from new api, falling back to compatibility mode"); ClipData clipData = intent.getClipData(); if (clipData != null && LEGACY_WEAR_EXTRA.equals(clipData.getDescription().getLabel())) { Bundle extras = clipData.getItemAt(0).getIntent().getExtras(); if (extras != null) { wearReply = extras.getString(NotificationActionUtils.WEAR_REPLY_INPUT); } } } if (!TextUtils.isEmpty(wearReply)) { createWearReplyTask(this, mRefMessageUri, UIProvider.MESSAGE_PROJECTION, mComposeMode, wearReply).execute(); finish(); return; } else { LogUtils.w(LOG_TAG, "remote input string is null"); } } getLoaderManager().initLoader(INIT_DRAFT_USING_REFERENCE_MESSAGE, null, this); return; } else if (message != null && action != EDIT_DRAFT) { initFromDraftMessage(message); initQuotedTextFromRefMessage(mRefMessage, action); mShowQuotedText = message.appendRefMessageContent; // if we should be showing quoted text but mRefMessage is null // and we have some quotedText, display that if (mShowQuotedText && mRefMessage == null) { if (quotedText != null) { initQuotedText(quotedText, false /* shouldQuoteText */); } else if (mExtraValues != null) { initExtraValues(mExtraValues); return; } } } else if (action == EDIT_DRAFT) { if (message == null) { throw new IllegalStateException("Message must not be null to edit draft"); } initFromDraftMessage(message); // Update the action to the draft type of the previous draft switch (message.draftType) { case UIProvider.DraftType.REPLY: action = REPLY; break; case UIProvider.DraftType.REPLY_ALL: action = REPLY_ALL; break; case UIProvider.DraftType.FORWARD: action = FORWARD; break; case UIProvider.DraftType.COMPOSE: default: action = COMPOSE; break; } LogUtils.d(LOG_TAG, "Previous draft had action type: %d", action); mShowQuotedText = message.appendRefMessageContent; if (message.refMessageUri != null) { // If we're editing an existing draft that was in reference to an existing message, // still need to load that original message since we might need to refer to the // original sender and recipients if user switches "reply <-> reply-all". mRefMessageUri = message.refMessageUri; mComposeMode = action; getLoaderManager().initLoader(REFERENCE_MESSAGE_LOADER, null, this); return; } } else if ((action == REPLY || action == REPLY_ALL || action == FORWARD)) { if (mRefMessage != null) { initFromRefMessage(action); mShowQuotedText = true; } } else { if (initFromExtras(intent)) { return; } } mComposeMode = action; finishSetup(action, intent, savedState); }
From source file:im.neon.activity.LoginActivity.java
/** * Check if the identity server url has been updated * * @return true if the IS url has been updated *///from w ww. java2s. c o m private boolean onIdentityserverUrlUpdate() { if (!TextUtils.equals(mIdentityServerUrl, getIdentityServerUrl())) { mIdentityServerUrl = getIdentityServerUrl(); mRegistrationResponse = null; // invalidate the current homeserver config mHomeserverConnectionConfig = null; // the account creation is not always supported so ensure that the dedicated button is always displayed. mRegisterButton.setVisibility(View.VISIBLE); checkFlows(); return true; } return false; }
From source file:com.murrayc.galaxyzoo.app.QuestionFragment.java
/** * Avoid calling this from the main (UI) thread - StrictMode doesn't like it on at least API 15 * and API 16./*from w w w . j av a2 s . c om*/ * * @param classificationInProgress */ private void saveClassificationSync(final ClassificationInProgress classificationInProgress) { final String itemId = getItemId(); if (TextUtils.equals(itemId, ItemsContentProvider.URI_PART_ITEM_ID_NEXT)) { Log.error("QuestionFragment.saveClassification(): Attempting to save with the 'next' ID."); return; } final Activity activity = getActivity(); if (activity == null) return; final ContentResolver resolver = activity.getContentResolver(); // Add the related Classification Answers: // Use a ContentProvider operation to perform operations together, // either completely or not at all, as a transaction. // This should prevent an incomplete classification from being uploaded // before we have finished adding it. // // We use the specific ArrayList<> subtype instead of List<> because // ContentResolver.applyBatch() takes an ArrayList for some reason. final ArrayList<ContentProviderOperation> ops = new ArrayList<>(); int sequence = 0; final List<ClassificationInProgress.QuestionAnswer> answers = classificationInProgress.getAnswers(); if (answers != null) { for (final ClassificationInProgress.QuestionAnswer answer : answers) { ContentProviderOperation.Builder builder = ContentProviderOperation .newInsert(ClassificationAnswer.CLASSIFICATION_ANSWERS_URI); final ContentValues valuesAnswers = new ContentValues(); valuesAnswers.put(ClassificationAnswer.Columns.ITEM_ID, itemId); valuesAnswers.put(ClassificationAnswer.Columns.SEQUENCE, sequence); valuesAnswers.put(ClassificationAnswer.Columns.QUESTION_ID, answer.getQuestionId()); valuesAnswers.put(ClassificationAnswer.Columns.ANSWER_ID, answer.getAnswerId()); builder.withValues(valuesAnswers); ops.add(builder.build()); //For instance, if the question has multiple-choice checkboxes to select before clicking //the "Done" answer: final List<String> checkboxIds = answer.getCheckboxIds(); if (checkboxIds != null) { for (final String checkboxId : checkboxIds) { builder = ContentProviderOperation .newInsert(ClassificationCheckbox.CLASSIFICATION_CHECKBOXES_URI); final ContentValues valuesCheckbox = new ContentValues(); valuesCheckbox.put(ClassificationCheckbox.Columns.ITEM_ID, itemId); valuesCheckbox.put(ClassificationCheckbox.Columns.SEQUENCE, sequence); valuesCheckbox.put(ClassificationCheckbox.Columns.QUESTION_ID, answer.getQuestionId()); valuesCheckbox.put(ClassificationCheckbox.Columns.CHECKBOX_ID, checkboxId); builder.withValues(valuesCheckbox); ops.add(builder.build()); } } sequence++; } } //Mark the Item (Subject) as done: final Uri.Builder uriBuilder = Item.ITEMS_URI.buildUpon(); uriBuilder.appendPath(getItemId()); final ContentProviderOperation.Builder builder = ContentProviderOperation.newUpdate(uriBuilder.build()); final ContentValues values = new ContentValues(); values.put(Item.Columns.DONE, true); values.put(Item.Columns.DATETIME_DONE, getCurrentDateTimeAsIso8601()); values.put(Item.Columns.FAVORITE, classificationInProgress.isFavorite()); builder.withValues(values); ops.add(builder.build()); try { resolver.applyBatch(ClassificationAnswer.AUTHORITY, ops); } catch (final RemoteException | OperationApplicationException e) { //This should never happen, and would mean a loss of the current classification, //so let it crash the app and generate a report with a stacktrace, //because that's (slightly) better than just ignoring it. // //I guess that OperationApplicationException is not an unchecked exception, //because it could be caused by not just pure programmer error, //for instance if our data did not fulfill a Sqlite database constraint. Log.error("QuestionFragment. saveClassification(): Exception from applyBatch()", e); throw new RuntimeException("ContentResolver.applyBatch() failed.", e); } //The ItemsContentProvider will upload the classification later. }
From source file:im.neon.adapters.VectorMessagesAdapter.java
/** * Manage the select mode i.e highlight an item when the user tap on it * @param contentView the cell view.//from ww w . j av a2 s . c om * @param event the linked event */ private void manageSelectionMode(final View contentView, final Event event) { final String eventId = event.eventId; boolean isInSelectionMode = (null != mHighlightedEventId); boolean isHighlighted = TextUtils.equals(eventId, mHighlightedEventId); // display the action icon when selected contentView.findViewById(R.id.messagesAdapter_action_image) .setVisibility(isHighlighted ? View.VISIBLE : View.GONE); float alpha = (!isInSelectionMode || isHighlighted) ? 1.0f : 0.2f; // the message body is dimmed when not selected contentView.findViewById(R.id.messagesAdapter_body_view).setAlpha(alpha); contentView.findViewById(R.id.messagesAdapter_avatars_list).setAlpha(alpha); TextView tsTextView = (TextView) contentView .findViewById(org.matrix.androidsdk.R.id.messagesAdapter_timestamp); if (isInSelectionMode && isHighlighted) { tsTextView.setVisibility(View.VISIBLE); } contentView.findViewById(org.matrix.androidsdk.R.id.message_timestamp_layout_right) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (TextUtils.equals(eventId, mHighlightedEventId)) { onMessageClick(event, getEventText(contentView), contentView.findViewById(R.id.messagesAdapter_action_anchor)); } else { onEventTap(eventId); } } }); contentView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (!mIsSearchMode) { onMessageClick(event, getEventText(contentView), contentView.findViewById(R.id.messagesAdapter_action_anchor)); mHighlightedEventId = eventId; notifyDataSetChanged(); return true; } return false; } }); }
From source file:com.android.tv.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { if (DEBUG)// w w w . jav a2 s .c om Log.d(TAG, "onCreate()"); super.onCreate(savedInstanceState); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M && !PermissionUtils.hasAccessAllEpg(this)) { Toast.makeText(this, R.string.msg_not_supported_device, Toast.LENGTH_LONG).show(); finish(); return; } boolean skipToShowOnboarding = getIntent().getAction() == Intent.ACTION_VIEW && TvContract.isChannelUriForPassthroughInput(getIntent().getData()); if (Features.ONBOARDING_EXPERIENCE.isEnabled(this) && OnboardingUtils.needToShowOnboarding(this) && !skipToShowOnboarding && !TvCommonUtils.isRunningInTest()) { // TODO: The onboarding is turned off in test, because tests are broken by the // onboarding. We need to enable the feature for tests later. startActivity(OnboardingActivity.buildIntent(this, getIntent())); finish(); return; } TvApplication tvApplication = (TvApplication) getApplication(); tvApplication.getMainActivityWrapper().onMainActivityCreated(this); if (BuildConfig.ENG && SystemProperties.ALLOW_STRICT_MODE.getValue()) { Toast.makeText(this, "Using Strict Mode for eng builds", Toast.LENGTH_SHORT).show(); } mTracker = tvApplication.getTracker(); mTvInputManagerHelper = tvApplication.getTvInputManagerHelper(); mTvInputManagerHelper.addCallback(mTvInputCallback); mUsbTunerInputId = UsbTunerTvInputService.getInputId(this); mChannelDataManager = tvApplication.getChannelDataManager(); mProgramDataManager = tvApplication.getProgramDataManager(); mProgramDataManager.addOnCurrentProgramUpdatedListener(Channel.INVALID_ID, mOnCurrentProgramUpdatedListener); mProgramDataManager.setPrefetchEnabled(true); mChannelTuner = new ChannelTuner(mChannelDataManager, mTvInputManagerHelper); mChannelTuner.addListener(mChannelTunerListener); mChannelTuner.start(); mPipInputManager = new PipInputManager(this, mTvInputManagerHelper, mChannelTuner); mPipInputManager.start(); mMemoryManageables.add(mProgramDataManager); mMemoryManageables.add(ImageCache.getInstance()); mMemoryManageables.add(TvContentRatingCache.getInstance()); if (CommonFeatures.DVR.isEnabled(this) && BuildCompat.isAtLeastN()) { mDvrManager = tvApplication.getDvrManager(); mDvrDataManager = tvApplication.getDvrDataManager(); } DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE); Display display = displayManager.getDisplay(Display.DEFAULT_DISPLAY); Point size = new Point(); display.getSize(size); int screenWidth = size.x; int screenHeight = size.y; mDefaultRefreshRate = display.getRefreshRate(); mOverlayRootView = (OverlayRootView) getLayoutInflater().inflate(R.layout.overlay_root_view, null, false); setContentView(R.layout.activity_tv); mTvView = (TunableTvView) findViewById(R.id.main_tunable_tv_view); int shrunkenTvViewHeight = getResources().getDimensionPixelSize(R.dimen.shrunken_tvview_height); mTvView.initialize((AppLayerTvView) findViewById(R.id.main_tv_view), false, screenHeight, shrunkenTvViewHeight); mTvView.setOnUnhandledInputEventListener(new OnUnhandledInputEventListener() { @Override public boolean onUnhandledInputEvent(InputEvent event) { if (isKeyEventBlocked()) { return true; } if (event instanceof KeyEvent) { KeyEvent keyEvent = (KeyEvent) event; if (keyEvent.getAction() == KeyEvent.ACTION_DOWN && keyEvent.isLongPress()) { if (onKeyLongPress(keyEvent.getKeyCode(), keyEvent)) { return true; } } if (keyEvent.getAction() == KeyEvent.ACTION_UP) { return onKeyUp(keyEvent.getKeyCode(), keyEvent); } else if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) { return onKeyDown(keyEvent.getKeyCode(), keyEvent); } } return false; } }); mTimeShiftManager = new TimeShiftManager(this, mTvView, mProgramDataManager, mTracker, new OnCurrentProgramUpdatedListener() { @Override public void onCurrentProgramUpdated(long channelId, Program program) { updateMediaSession(); switch (mTimeShiftManager.getLastActionId()) { case TimeShiftManager.TIME_SHIFT_ACTION_ID_REWIND: case TimeShiftManager.TIME_SHIFT_ACTION_ID_FAST_FORWARD: case TimeShiftManager.TIME_SHIFT_ACTION_ID_JUMP_TO_PREVIOUS: case TimeShiftManager.TIME_SHIFT_ACTION_ID_JUMP_TO_NEXT: updateChannelBannerAndShowIfNeeded(UPDATE_CHANNEL_BANNER_REASON_FORCE_SHOW); break; default: updateChannelBannerAndShowIfNeeded(UPDATE_CHANNEL_BANNER_REASON_UPDATE_INFO); break; } } }); mPipView = (TunableTvView) findViewById(R.id.pip_tunable_tv_view); mPipView.initialize((AppLayerTvView) findViewById(R.id.pip_tv_view), true, screenHeight, shrunkenTvViewHeight); if (!PermissionUtils.hasAccessWatchedHistory(this)) { WatchedHistoryManager watchedHistoryManager = new WatchedHistoryManager(getApplicationContext()); watchedHistoryManager.start(); mTvView.setWatchedHistoryManager(watchedHistoryManager); } mTvViewUiManager = new TvViewUiManager(this, mTvView, mPipView, (FrameLayout) findViewById(android.R.id.content), mTvOptionsManager); mPipView.setFixedSurfaceSize(screenWidth / 2, screenHeight / 2); mPipView.setBlockScreenType(TunableTvView.BLOCK_SCREEN_TYPE_SHRUNKEN_TV_VIEW); ViewGroup sceneContainer = (ViewGroup) findViewById(R.id.scene_container); mChannelBannerView = (ChannelBannerView) getLayoutInflater().inflate(R.layout.channel_banner, sceneContainer, false); mKeypadChannelSwitchView = (KeypadChannelSwitchView) getLayoutInflater() .inflate(R.layout.keypad_channel_switch, sceneContainer, false); InputBannerView inputBannerView = (InputBannerView) getLayoutInflater().inflate(R.layout.input_banner, sceneContainer, false); SelectInputView selectInputView = (SelectInputView) getLayoutInflater().inflate(R.layout.select_input, sceneContainer, false); selectInputView.setOnInputSelectedCallback(new OnInputSelectedCallback() { @Override public void onTunerInputSelected() { Channel currentChannel = mChannelTuner.getCurrentChannel(); if (currentChannel != null && !currentChannel.isPassthrough()) { hideOverlays(); } else { tuneToLastWatchedChannelForTunerInput(); } } @Override public void onPassthroughInputSelected(TvInputInfo input) { Channel currentChannel = mChannelTuner.getCurrentChannel(); String currentInputId = currentChannel == null ? null : currentChannel.getInputId(); if (TextUtils.equals(input.getId(), currentInputId)) { hideOverlays(); } else { tuneToChannel(Channel.createPassthroughChannel(input.getId())); } } private void hideOverlays() { getOverlayManager().hideOverlays(TvOverlayManager.FLAG_HIDE_OVERLAYS_KEEP_DIALOG | TvOverlayManager.FLAG_HIDE_OVERLAYS_KEEP_SIDE_PANELS | TvOverlayManager.FLAG_HIDE_OVERLAYS_KEEP_PROGRAM_GUIDE | TvOverlayManager.FLAG_HIDE_OVERLAYS_KEEP_MENU | TvOverlayManager.FLAG_HIDE_OVERLAYS_KEEP_FRAGMENT); } }); mSearchFragment = new ProgramGuideSearchFragment(); mOverlayManager = new TvOverlayManager(this, mChannelTuner, mKeypadChannelSwitchView, mChannelBannerView, inputBannerView, selectInputView, sceneContainer, mSearchFragment); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mAudioFocusStatus = AudioManager.AUDIOFOCUS_LOSS; mMediaSession = new MediaSession(this, MEDIA_SESSION_TAG); mMediaSession.setCallback(new MediaSession.Callback() { @Override public boolean onMediaButtonEvent(Intent mediaButtonIntent) { // Consume the media button event here. Should not send it to other apps. return true; } }); mMediaSession .setFlags(MediaSession.FLAG_HANDLES_MEDIA_BUTTONS | MediaSession.FLAG_HANDLES_TRANSPORT_CONTROLS); mNowPlayingCardWidth = getResources().getDimensionPixelSize(R.dimen.notif_card_img_max_width); mNowPlayingCardHeight = getResources().getDimensionPixelSize(R.dimen.notif_card_img_height); mTvViewUiManager.restoreDisplayMode(false); if (!handleIntent(getIntent())) { finish(); return; } mAudioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, new AudioCapabilitiesReceiver.OnAc3PassthroughCapabilityChangeListener() { @Override public void onAc3PassthroughCapabilityChange(boolean capability) { mAc3PassthroughSupported = capability; } }); mAudioCapabilitiesReceiver.register(); mAccessibilityManager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE); mSendConfigInfoRecurringRunner = new RecurringRunner(this, TimeUnit.DAYS.toMillis(1), new SendConfigInfoRunnable(mTracker, mTvInputManagerHelper), null); mSendConfigInfoRecurringRunner.start(); mChannelStatusRecurringRunner = SendChannelStatusRunnable.startChannelStatusRecurringRunner(this, mTracker, mChannelDataManager); // To avoid not updating Rating systems when changing language. mTvInputManagerHelper.getContentRatingsManager().update(); initForTest(); }
From source file:com.zhihu.android.app.mirror.app.MainActivity.java
private void onMirrorMessageArtboard(Message message) { Content content = message.getContent(); int position = -1; for (int i = 0; i < mArtboardList.size(); i++) { Artboard artboard = mArtboardList.get(i); if (TextUtils.equals(artboard.getId(), content.getIdentifier())) { artboard.setNeedUpdateInList(true); artboard.setNeedUpdateInPager(true); position = i;//from w w w . j av a 2 s .c o m break; } } // add 1 for top placeholder if (position >= 0) { mArtboardListAdapter.notifyItemChanged(position + 1); mArtboardPagerAdapter.notifyDataSetChanged(); mArtboardPagerView.setCurrentItem(position, false); } }
From source file:com.zhihu.android.app.mirror.app.MainActivity.java
private void onMirrorMessageCurrentArtboard(Message message) { String id = message.getContent().getIdentifier(); int position = -1; for (int i = 0; i < mArtboardList.size(); i++) { Artboard artboard = mArtboardList.get(i); if (TextUtils.equals(artboard.getId(), id)) { position = i;/*from ww w .j av a 2s . c o m*/ break; } } if (position >= 0) { mArtboardPagerView.setCurrentItem(position, false); } }