private void setResultAndFinish(final String accountName, final String accountType) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_NAME, accountName); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, accountType); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseTypeAndAccountActivity.setResultAndFinish: " + "selected account " + accountName + ", " + accountType); finish(); }
private void setResultAndFinish(final String type) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, type); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseAccountTypeActivity.setResultAndFinish: " + "selected account type " + type); finish(); }
Context base = mNotificationCompat.getHostContext(); init(base); VLog.v(TAG, "createView:big=" + isBig + ",system=" + systemId); VLog.v(TAG, "createView:getNotificationWidth=" + width); ViewGroup frameLayout = new FrameLayout(context); VLog.v(TAG, "createView:apply"); frameLayout.addView(view1, params); if (view1 instanceof ViewGroup) { VLog.v(TAG, "createView:fixTextView"); fixTextView((ViewGroup) view1); VLog.v(TAG, "createView:layout"); View mCache = frameLayout; mCache.layout(0, 0, width, height); View.MeasureSpec.makeMeasureSpec(height, mode)); mCache.layout(0, 0, width, mCache.getMeasuredHeight()); VLog.v(TAG, "notification:systemId=" + systemId + ",max=%d/%d, szie=%d/%d", width, height, mCache.getMeasuredWidth(), mCache.getMeasuredHeight()); return mCache;
/** * * @param remoteViews notification's old remoteViews * @param remoteview notification's old remoteViews view * @param oldRemoteView notification's new remoteViews view */ public void setPendIntent(RemoteViews remoteViews, View remoteview, View oldRemoteView) { if (findPendIntents() > 0) { Iterator<Map.Entry<Integer, PendingIntent>> set = clickIntents.entrySet().iterator(); List<RectInfo> list = new ArrayList<>(); int index = 0; VLog.v(TAG, "start find intent"); while (set.hasNext()) { Map.Entry<Integer, PendingIntent> e = set.next(); View view = oldRemoteView.findViewById(e.getKey()); if (view != null) { Rect rect = getRect(view); list.add(new RectInfo(rect, e.getValue(), index)); index++; } } VLog.v(TAG, "find:" + list); if (remoteview instanceof ViewGroup) { setIntentByViewGroup(remoteViews, (ViewGroup) remoteview, list); } } }
private void startChooseAccountTypeActivity() { VLog.v(TAG, "ChooseAccountTypeActivity.startChooseAccountTypeActivity()"); final Intent intent = new Intent(this, ChooseAccountTypeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.putExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE, getIntent().getBundleExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE)); intent.putExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING, getIntent().getStringExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING)); startActivityForResult(intent, REQUEST_CHOOSE_TYPE); mPendingRequest = REQUEST_CHOOSE_TYPE; }
layoutId = R.layout.custom_notification; VLog.v(TAG, "createviews id = " + layoutId); VLog.v(TAG, "remoteViews to view"); View cache = toView(pluginContext, contentView, isBig, systemId); VLog.v(TAG, "start createBitmap"); final Bitmap bmp = createBitmap(cache); if (bmp == null) { VLog.v(TAG, "bmp w=" + bmp.getWidth() + ",h=" + bmp.getHeight()); VLog.v(TAG, "recycle " + key); old.recycle(); VLog.v(TAG, "createview " + key); synchronized (mImages) { mImages.put(key, bmp); VLog.v(TAG, "start setPendIntent"); try { pendIntentCompat.setPendIntent(remoteViews,
/** * Populates the UI ListView with the given list of items and selects an item * based on {@code mSelectedItemIndex} member variable. */ private void populateUIAccountList(String[] listItems) { ListView list = (ListView) findViewById(android.R.id.list); list.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, listItems)); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setItemsCanFocus(false); list.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { mSelectedItemIndex = position; mOkButton.setEnabled(true); } }); if (mSelectedItemIndex != SELECTED_ITEM_NONE) { list.setItemChecked(mSelectedItemIndex, true); VLog.v(TAG, "List item " + mSelectedItemIndex + " should be selected"); } } }
VLog.v(TAG, "selected account name is " + mSelectedAccountName);
VLog.v(TAG, "find icon " + methodName + " type=" + type + ", value=" + value);
private void setResultAndFinish(final String accountName, final String accountType) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_NAME, accountName); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, accountType); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseTypeAndAccountActivity.setResultAndFinish: " + "selected account " + accountName + ", " + accountType); finish(); }
private void setResultAndFinish(final String accountName, final String accountType) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_NAME, accountName); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, accountType); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseTypeAndAccountActivity.setResultAndFinish: " + "selected account " + accountName + ", " + accountType); finish(); }
private void setResultAndFinish(final String type) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, type); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseAccountTypeActivity.setResultAndFinish: " + "selected account type " + type); finish(); }
private void setResultAndFinish(final String type) { Bundle bundle = new Bundle(); bundle.putString(AccountManager.KEY_ACCOUNT_TYPE, type); setResult(Activity.RESULT_OK, new Intent().putExtras(bundle)); VLog.v(TAG, "ChooseAccountTypeActivity.setResultAndFinish: " + "selected account type " + type); finish(); }
Context base = mNotificationCompat.getHostContext(); init(base); VLog.v(TAG, "createView:big=" + isBig + ",system=" + systemId); VLog.v(TAG, "createView:getNotificationWidth=" + width); ViewGroup frameLayout = new FrameLayout(context); VLog.v(TAG, "createView:apply"); frameLayout.addView(view1, params); if (view1 instanceof ViewGroup) { VLog.v(TAG, "createView:fixTextView"); fixTextView((ViewGroup) view1); VLog.v(TAG, "createView:layout"); View mCache = frameLayout; mCache.layout(0, 0, width, height); View.MeasureSpec.makeMeasureSpec(height, mode)); mCache.layout(0, 0, width, mCache.getMeasuredHeight()); VLog.v(TAG, "notification:systemId=" + systemId + ",max=%d/%d, szie=%d/%d", width, height, mCache.getMeasuredWidth(), mCache.getMeasuredHeight()); return mCache;
/** * * @param remoteViews notification's old remoteViews * @param remoteview notification's old remoteViews view * @param oldRemoteView notification's new remoteViews view */ public void setPendIntent(RemoteViews remoteViews, View remoteview, View oldRemoteView) { if (findPendIntents() > 0) { Iterator<Map.Entry<Integer, PendingIntent>> set = clickIntents.entrySet().iterator(); List<RectInfo> list = new ArrayList<>(); int index = 0; VLog.v(TAG, "start find intent"); while (set.hasNext()) { Map.Entry<Integer, PendingIntent> e = set.next(); View view = oldRemoteView.findViewById(e.getKey()); if (view != null) { Rect rect = getRect(view); list.add(new RectInfo(rect, e.getValue(), index)); index++; } } VLog.v(TAG, "find:" + list); if (remoteview instanceof ViewGroup) { setIntentByViewGroup(remoteViews, (ViewGroup) remoteview, list); } } }
/** * * @param remoteViews notification's old remoteViews * @param remoteview notification's old remoteViews view * @param oldRemoteView notification's new remoteViews view */ public void setPendIntent(RemoteViews remoteViews, View remoteview, View oldRemoteView) { if (findPendIntents() > 0) { Iterator<Map.Entry<Integer, PendingIntent>> set = clickIntents.entrySet().iterator(); List<RectInfo> list = new ArrayList<>(); int index = 0; VLog.v(TAG, "start find intent"); while (set.hasNext()) { Map.Entry<Integer, PendingIntent> e = set.next(); View view = oldRemoteView.findViewById(e.getKey()); if (view != null) { Rect rect = getRect(view); list.add(new RectInfo(rect, e.getValue(), index)); index++; } } VLog.v(TAG, "find:" + list); if (remoteview instanceof ViewGroup) { setIntentByViewGroup(remoteViews, (ViewGroup) remoteview, list); } } }
private void startChooseAccountTypeActivity() { VLog.v(TAG, "ChooseAccountTypeActivity.startChooseAccountTypeActivity()"); final Intent intent = new Intent(this, ChooseAccountTypeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.putExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE, getIntent().getBundleExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE)); intent.putExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING, getIntent().getStringExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING)); startActivityForResult(intent, REQUEST_CHOOSE_TYPE); mPendingRequest = REQUEST_CHOOSE_TYPE; }
private void startChooseAccountTypeActivity() { VLog.v(TAG, "ChooseAccountTypeActivity.startChooseAccountTypeActivity()"); final Intent intent = new Intent(this, ChooseAccountTypeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); intent.putExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE, getIntent().getBundleExtra(EXTRA_ADD_ACCOUNT_OPTIONS_BUNDLE)); intent.putExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY, getIntent().getStringArrayExtra(EXTRA_ADD_ACCOUNT_REQUIRED_FEATURES_STRING_ARRAY)); intent.putExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING, getIntent().getStringExtra(EXTRA_ADD_ACCOUNT_AUTH_TOKEN_TYPE_STRING)); startActivityForResult(intent, REQUEST_CHOOSE_TYPE); mPendingRequest = REQUEST_CHOOSE_TYPE; }
/** * Populates the UI ListView with the given list of items and selects an item * based on {@code mSelectedItemIndex} member variable. */ private void populateUIAccountList(String[] listItems) { ListView list = (ListView) findViewById(android.R.id.list); list.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, listItems)); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setItemsCanFocus(false); list.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { mSelectedItemIndex = position; mOkButton.setEnabled(true); } }); if (mSelectedItemIndex != SELECTED_ITEM_NONE) { list.setItemChecked(mSelectedItemIndex, true); VLog.v(TAG, "List item " + mSelectedItemIndex + " should be selected"); } } }
/** * Populates the UI ListView with the given list of items and selects an item * based on {@code mSelectedItemIndex} member variable. */ private void populateUIAccountList(String[] listItems) { ListView list = (ListView) findViewById(android.R.id.list); list.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_single_choice, listItems)); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); list.setItemsCanFocus(false); list.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { mSelectedItemIndex = position; mOkButton.setEnabled(true); } }); if (mSelectedItemIndex != SELECTED_ITEM_NONE) { list.setItemChecked(mSelectedItemIndex, true); VLog.v(TAG, "List item " + mSelectedItemIndex + " should be selected"); } } }