private void rebuildComplicationsList() { ViewGroup complicationsContainer = (ViewGroup) mRootView.findViewById(R.id.complications_list); complicationsContainer.removeAllViews(); LayoutInflater inflater = LayoutInflater.from(getActivity()); for (int i = 0; i < PREF_KEYS.length; i++) { final String prefKey = PREF_KEYS[i]; ViewGroup itemContainer = (ViewGroup) inflater.inflate(R.layout.config_complications_item, complicationsContainer, false); final CheckedTextView titleView = (CheckedTextView) itemContainer.findViewById(android.R.id.text1); final View checkmarkView = itemContainer.findViewById(R.id.checkmark); titleView.setText(PREF_TITLE_IDS[i]); boolean isPrefOn = mSharedPreferences.getBoolean(prefKey, false); checkmarkView.setVisibility(isPrefOn ? View.VISIBLE : View.INVISIBLE); titleView.setChecked(isPrefOn); itemContainer.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { boolean isPrefOn = mSharedPreferences.getBoolean(prefKey, false); mSharedPreferences.edit().putBoolean(prefKey, !isPrefOn).apply(); rebuildComplicationsList(); } }); complicationsContainer.addView(itemContainer); } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.post_fragment, container, false); mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recycler_view); mProgressLoadMore = (ProgressBar) rootView.findViewById(R.id.progress); mEmptyView = rootView.findViewById(R.id.empty_view); mEmptyViewTitle = (TextView) mEmptyView.findViewById(R.id.title_empty); mEmptyViewImage = (ImageView) mEmptyView.findViewById(R.id.image_empty); Context context = getActivity(); mRecyclerView.setLayoutManager(new LinearLayoutManager(context)); int spacingVertical = context.getResources().getDimensionPixelSize(R.dimen.reader_card_gutters); int spacingHorizontal = context.getResources().getDimensionPixelSize(R.dimen.content_margin); mRecyclerView.addItemDecoration(new RecyclerItemDecoration(spacingHorizontal, spacingVertical)); // mEmptyViewImage.setVisibility(View.VISIBLE); // mEmptyView.setVisibility(View.VISIBLE); return rootView; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_search); _imgDownloader = new ImageDownloader(this); _imgDownloader.setImageFilePrefix(AppConfig.IMAGE_CACHE_FILE_PREFIX); // 标题 TextView titleTextView = (TextView) this.findViewById(R.id.textViewTitle); titleTextView.setText("搜索"); _loadingLayer = (ViewGroup) findViewById(R.id.loading_layer); _loadingImageView = (ImageView) _loadingLayer.findViewById(R.id.imageViewLoading); _loadingTextView = (TextView) _loadingLayer.findViewById(R.id.textViewLoading); _inputBoxTextView = (TextView) this.findViewById(R.id.textViewInputBox); _listView = (ListView) this.findViewById(R.id.listView); _listView.setDividerHeight(0); _listView.setSelector(R.drawable.bg_download_list_selected); _listView.setVerticalScrollBarEnabled(true); _listView.setOnItemClickListener(this); _adapter = new MyAdapter(this); _listView.setAdapter(_adapter); buildKeyboard(); // HomeDataLoader.loadAllAppList(this, _allAppList); }
public final View getView(int paramInt, View paramView, ViewGroup paramViewGroup) { paramViewGroup = paramView; if (paramView == null) { paramViewGroup = View.inflate(FileExplorerUI.this, a.k.mail_file_explorer_item, null); paramView = new FileExplorerUI.c(FileExplorerUI.this, (byte)0); cwg = ((ImageView)paramViewGroup.findViewById(a.i.file_icon_iv)); cFf = ((TextView)paramViewGroup.findViewById(a.i.file_name_tv)); hee = ((TextView)paramViewGroup.findViewById(a.i.file_summary_tv)); paramViewGroup.setTag(paramView); } Object localObject = (FileExplorerUI.c)paramViewGroup.getTag(); paramView = (File)getItem(paramInt); if (paramView == hdZ) { cFf.setText(paramView.getName()); cwg.setImageResource(a.h.qqmail_attach_back); hee.setVisibility(0); return paramViewGroup; } cwg.setImageResource(FileExplorerUI.i(paramView)); cFf.setText(paramView.getName()); localObject = hee; StringBuilder localStringBuilder = new StringBuilder().append(DateFormat.format("yyyy-MM-dd hh:mm:ss", paramView.lastModified()).toString()); if (paramView.isDirectory()) {} for (paramView = "";; paramView = " " + bn.W(paramView.length())) { ((TextView)localObject).setText(paramView); return paramViewGroup; } }
/** {@inheritDoc} */ @Override public View onCreateView( final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { // The View for the fragment's UI final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_music_browser_phone, container, false); // Initialize the adapter mPagerAdapter = new PagerAdapter(getActivity()); final MusicFragments[] mFragments = MusicFragments.values(); for (final MusicFragments mFragment : mFragments) { mPagerAdapter.add(mFragment.getFragmentClass(), null); } // Initialize the ViewPager mViewPager = (ViewPager) rootView.findViewById(R.id.fragment_home_phone_pager); // Attch the adapter mViewPager.setAdapter(mPagerAdapter); // Offscreen pager loading limit mViewPager.setOffscreenPageLimit(mPagerAdapter.getCount() - 1); // Start on the last page the user was on mViewPager.setCurrentItem(mPreferences.getStartPage()); // Initialze the TPI final TitlePageIndicator pageIndicator = (TitlePageIndicator) rootView.findViewById(R.id.fragment_home_phone_pager_titles); // Attach the ViewPager pageIndicator.setViewPager(mViewPager); // Scroll to the current artist, album, or song pageIndicator.setOnCenterItemClickListener(this); return rootView; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup view = (ViewGroup) inflater.inflate(layout, container, false); listView = (ListView) view.findViewById(R.id.com_facebook_picker_list_view); listView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { onListItemClick((ListView) parent, v, position); } }); listView.setOnLongClickListener( new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { // We don't actually do anything differently on long-clicks, but setting the listener // enables the selector transition that we have for visual consistency with the // Facebook app's pickers. return false; } }); listView.setOnScrollListener(onScrollListener); activityCircle = (ProgressBar) view.findViewById(R.id.com_facebook_picker_activity_circle); setupViews(view); listView.setAdapter(adapter); return view; }
@Override public View getChildView( int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { ViewGroup item; if (convertView != null && convertView.getId() == R.id.child_item) { // We can reuse the view item = (ViewGroup) convertView; } else { // We create a new View item = (ViewGroup) inflater.inflate(R.layout.child_item_layout, parent, false); } ChildClass child = (ChildClass) getChild(groupPosition, childPosition); TextView nameView = (TextView) item.findViewById(R.id.child_name); nameView.setText(child.getName()); TextView sizeView = (TextView) item.findViewById(R.id.child_text); sizeView.setText(child.getText()); return item; }
@Override public View getView(final int position, View reuse, ViewGroup parent) { // TODO Auto-generated method stub if (reuse != null) { message = (TextView) reuse.findViewById(R.id.msg_read_body); postedBy = (TextView) reuse.findViewById(R.id.msg_read_posted_by); // postedDate = (TextView)reuse.findViewById(R.id.msg_read_posted_date); final Message msg = msgList.get(position); // Refreshing Values postedBy.setText(msg.getPostedFrom()); // postedDate.setText(msg.getPostedDate()); message.setText(msg.getMessage()); return reuse; } else { ViewGroup item = getViewGroup(reuse, parent); message = (TextView) item.findViewById(R.id.msg_read_body); postedBy = (TextView) item.findViewById(R.id.msg_read_posted_by); // postedDate = (TextView)item.findViewById(R.id.msg_read_posted_date); final Message msg = msgList.get(position); // Refreshing Values postedBy.setText(msg.getPostedFrom()); // postedDate.setText(msg.getPostedDate()); message.setText(msg.getMessage()); return item; } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout containing a title and body text. ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.estadistica_view, container, false); int idEstadistica = this.mPageNumber; // Titulo y descripcion de estadistica TextView tituloEstadistica = (TextView) rootView.findViewById(R.id.TxtTituloEstadistica); TextView descEstadistica = (TextView) rootView.findViewById(R.id.TxtDescEstadistica); tituloEstadistica.setText(RelacionEstadisticas.getRelacion().get(idEstadistica).getTitulo()); descEstadistica.setText(RelacionEstadisticas.getRelacion().get(idEstadistica).getDescripcion()); rootView.addView( new EstadisticaViewLayout(Utilidades.getAppContext()) .getView(RelacionEstadisticas.getRelacion().get(idEstadistica))); // } // catch (Exception e) // { // Toast.makeText(Utilidades.getAppContext(), "error: " + e.getLocalizedMessage(), // Toast.LENGTH_LONG).show(); // Log.e("ERROR", e.getLocalizedMessage()); // } // Set the title view to show the page number. /*((TextView) rootView.findViewById(android.R.id.text1)).setText( getString(R.string.title_template_step, mPageNumber + 1));*/ return rootView; }
/** * Creates an instance of {@link EnhancedBookmarkManager}. It also initializes resources, bookmark * models and jni bridges. * * @param activity The activity context to use. */ public EnhancedBookmarkManager(Activity activity) { mActivity = activity; mEnhancedBookmarksModel = new EnhancedBookmarksModel(); mMainView = (ViewGroup) mActivity.getLayoutInflater().inflate(R.layout.eb_main, null); mDrawer = (DrawerLayout) mMainView.findViewById(R.id.eb_drawer_layout); mDrawerListView = (EnhancedBookmarkDrawerListView) mMainView.findViewById(R.id.eb_drawer_list); mContentView = (EnhancedBookmarkContentView) mMainView.findViewById(R.id.eb_content_view); mViewSwitcher = (ViewSwitcher) mMainView.findViewById(R.id.eb_view_switcher); mUndoController = new EnhancedBookmarkUndoController( activity, mEnhancedBookmarksModel, ((SnackbarManageable) activity).getSnackbarManager()); mSearchView = (EnhancedBookmarkSearchView) getView().findViewById(R.id.eb_search_view); mEnhancedBookmarksModel.addObserver(mBookmarkModelObserver); initializeIfBookmarkModelLoaded(); // Load partner bookmarks explicitly. We load partner bookmarks in the deferred startup // code, but that might be executed much later. Especially on L, showing loading // progress bar blocks that so it won't be loaded. http://crbug.com/429383 PartnerBookmarksShim.kickOffReading(activity); mLargeIconBridge = new LargeIconBridge(Profile.getLastUsedProfile().getOriginalProfile()); ActivityManager activityManager = ((ActivityManager) ApplicationStatus.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)); int maxSize = Math.min(activityManager.getMemoryClass() / 4 * 1024 * 1024, FAVICON_MAX_CACHE_SIZE_BYTES); mLargeIconBridge.createCache(maxSize); }
private void initUI(ViewGroup container) { etWhat = (EditText) container.findViewById(R.id.etWhat); etWhere = (EditText) container.findViewById(R.id.etWhere); btnSearchGo = (Button) container.findViewById(R.id.btnSearchGo); btnSearchGo.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (new QuerySearchFragment().isNetConnected()) { Toast.makeText( ctx, "WHAT:\n" + etWhat.getText().toString().trim() + "\n\nWHERE:\n" + etWhere.getText().toString().trim(), Toast.LENGTH_LONG) .show(); querySearchGoClickedListener.querySearchGoClicked( etWhat.getText().toString().trim(), etWhere.getText().toString().trim()); } } }); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_login_loading, container, false); final View takingAWhilePanel = rootView.findViewById(R.id.taking_a_while_panel); final View tryAgainButton = rootView.findViewById(R.id.retry_button); tryAgainButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { getFragmentManager().popBackStack(); } }); mHandler.postDelayed( new Runnable() { @Override public void run() { if (!isAdded()) { return; } takingAWhilePanel.setVisibility(View.VISIBLE); } }, TRY_AGAIN_DELAY_MILLIS); return rootView; }
public final View getView(int paramInt, View paramView, ViewGroup paramViewGroup) { paramViewGroup = paramView; if (paramView == null) { paramViewGroup = View.inflate(iRO, 2131363042, null); paramView = new FileExplorerUI.c(iRO, (byte)0); cNV = ((ImageView)paramViewGroup.findViewById(2131165873)); dda = ((TextView)paramViewGroup.findViewById(2131165768)); iRW = ((TextView)paramViewGroup.findViewById(2131169058)); paramViewGroup.setTag(paramView); } Object localObject = (FileExplorerUI.c)paramViewGroup.getTag(); paramView = (File)getItem(paramInt); if (paramView == iRR) { dda.setText(paramView.getName()); cNV.setImageResource(2130970138); iRW.setVisibility(0); return paramViewGroup; } cNV.setImageResource(FileExplorerUI.l(paramView)); dda.setText(paramView.getName()); localObject = iRW; StringBuilder localStringBuilder = new StringBuilder().append(DateFormat.format("yyyy-MM-dd hh:mm:ss", paramView.lastModified()).toString()); if (paramView.isDirectory()) {} for (paramView = "";; paramView = " " + ay.al(paramView.length())) { ((TextView)localObject).setText(paramView); return paramViewGroup; } }
private void init(LayoutInflater inflater) { new Thread( new Runnable() { @Override public void run() { playbackService = PlaybackService.get(getContext()); } }) .start(); view = (ViewGroup) inflater.inflate(getLayoutId(), null); listView = getListView(view); emptyMessage = getMessageView(view); adapter = getAdapter(inflater.getContext()); listView.setAdapter(adapter); playLastPlaylist = view.findViewById(R.id.lastPlayedPlaylist); createNewPlayList = view.findViewById(R.id.createNewPlaylist); animateListView(listView, adapter); initListeners(); updatePlaylist(); if (adapter.isEmpty()) { listView.setEmptyView(emptyMessage); } adapter.getCount(); }
public static void update(ViewGroup group, Actor actor) { TableLayout actorinfo_stats_table = (TableLayout) group.findViewById(R.id.actorinfo_stats_table); updateTraitsTable( actorinfo_stats_table, actor.getMoveCost(), actor.getAttackCost(), actor.getAttackChance(), actor.getDamagePotential(), actor.getCriticalSkill(), actor.getCriticalMultiplier(), actor.getBlockChance(), actor.getDamageResistance(), actor.isImmuneToCriticalHits()); TextView actorinfo_currentconditions_title = (TextView) group.findViewById(R.id.actorinfo_currentconditions_title); ActorConditionList actorinfo_currentconditions = (ActorConditionList) group.findViewById(R.id.actorinfo_currentconditions); if (actor.conditions.isEmpty()) { actorinfo_currentconditions_title.setVisibility(View.GONE); actorinfo_currentconditions.setVisibility(View.GONE); } else { actorinfo_currentconditions_title.setVisibility(View.VISIBLE); actorinfo_currentconditions.setVisibility(View.VISIBLE); actorinfo_currentconditions.update(actor.conditions); } }
@SuppressLint("InflateParams") @Override protected void onCreate(Bundle savedInstanceState) { ALog.v(TAG, "onCreate. Entry..."); super.onCreate(savedInstanceState); ViewGroup viewGroup = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_select, null); setContentView(viewGroup); listOfApps = (ListView) viewGroup.findViewById(R.id.selectList); TextView headline = (TextView) viewGroup.findViewById(R.id.selectDescription); StateMachine.loadGPSAwareApplications(true); applications = StateMachine.getGPSAwareApplicationsList(); if (applications.size() > 0) { listOfApps.setAdapter(new StableArrayAdapter(this)); headline.setText(R.string.selectDescription); } else { headline.setText(R.string.selectDescriptionNo); } ALog.v(TAG, "onCreate. Exit."); }
public void addItem(String title) { view.findViewById(R.id.planner_empty).setVisibility(View.INVISIBLE); LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); final ViewGroup newView = (ViewGroup) inflater.inflate(R.layout.fragment_planner_list_item, mContainerView, false); TextView tv = (TextView) newView.findViewById(R.id.planner_item_text); ImageButton ib = (ImageButton) newView.findViewById(R.id.planner_item_delete); tv.setText("HELLO WORLD!"); ib.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // mContainerView.removeView(newView); newView.setVisibility(View.GONE); if (mContainerView.getChildCount() == 0) { view.findViewById(R.id.planner_empty).setVisibility(View.VISIBLE); } } }); mContainerView.addView(newView, 0); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_sale_skidkaonline, container, false); setHasOptionsMenu(true); setRetainInstance(true); sale = getArguments().getParcelable(CURRENT_SALE_TAG); progressBar = (CircularProgressView) rootView.findViewById(R.id.fragment_sale_progressbar); imageView = (SubsamplingScaleImageView) rootView.findViewById(R.id.fragment_sale_imageview); imageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CUSTOM); imageView.setMaxScale(getResources().getDimension(R.dimen.image_maximum_scale)); File smallFile = ImageLoader.getInstance().getDiskCache().get(sale.getSmallImageUrl()); if (smallFile != null) { imageView.setImage(ImageSource.uri(smallFile.getAbsolutePath())); loadBigImage(); } else { ImageLoader.getInstance() .loadImage( sale.getSmallImageUrl(), null, UIL.getScaleImageOptions(), new ImageLoadingListener() { @Override public void onLoadingStarted(String s, View view) { progressBar.setVisibility(View.VISIBLE); } @Override public void onLoadingFailed(String s, View view, FailReason failReason) { progressBar.setVisibility(View.GONE); } @Override public void onLoadingComplete(String s, View view, Bitmap bitmap) { File smallFile = ImageLoader.getInstance().getDiskCache().get(sale.getSmallImageUrl()); if (smallFile != null) { imageView.setImage(ImageSource.uri(smallFile.getAbsolutePath())); } bitmap.recycle(); loadBigImage(); } @Override public void onLoadingCancelled(String s, View view) {} }, new ImageLoadingProgressListener() { @Override public void onProgressUpdate(String s, View view, int progress, int size) { progressBar.setProgress(progress * 500 / size); } }); } return rootView; }
@Override protected void setupViewItems(ViewGroup viewGroup, CheckListItem checkListItem) { this.layoutView = (LinearLayout) viewGroup.findViewById(R.id.lst_layout); this.checkBox = (CheckBox) viewGroup.findViewById(R.id.lst_check); this.progressBar = (ProgressBar) viewGroup.findViewById(R.id.lst_level); this.unitView = (TextView) viewGroup.findViewById(R.id.lst_unit); this.progressBar.setMax((int) checkListItem.getMax_val()); }
private void initUI() { imgIcon = (ImageView) rootView.findViewById(R.id.img_challenge_detail1_icon); txtName = (TextView) rootView.findViewById(R.id.txt_challenge_detail1_name); txtTimer = (TextView) rootView.findViewById(R.id.txt_challenge_detail1_timer); btnFinished = (Button) rootView.findViewById(R.id.btn_challenge_detail1_finished); }
private void displayProfileImage(ViewGroup view, int viewId, String path) { if ("".equals(path)) { ((ImageView) view.findViewById(viewId)).setImageResource(R.drawable.profile); return; } ImageLoader.getInstance() .displayImage("http://www.combomobile.com" + path, ((ImageView) view.findViewById(viewId))); }
@Override public View getView(final int position, final View convertView, final ViewGroup parent) { final ViewGroup row; if (convertView == null) row = (ViewGroup) getLayoutInflater(null).inflate(R.layout.block_row, null); else row = (ViewGroup) convertView; final StoredBlock storedBlock = getItem(position); final Block header = storedBlock.getHeader(); final TextView rowHeight = (TextView) row.findViewById(R.id.block_list_row_height); final int height = storedBlock.getHeight(); rowHeight.setText(Integer.toString(height)); final TextView rowTime = (TextView) row.findViewById(R.id.block_list_row_time); final long timeMs = header.getTimeSeconds() * DateUtils.SECOND_IN_MILLIS; rowTime.setText( DateUtils.getRelativeDateTimeString( activity, timeMs, DateUtils.MINUTE_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, 0)); final TextView rowHash = (TextView) row.findViewById(R.id.block_list_row_hash); rowHash.setText(WalletUtils.formatHash(null, header.getHashAsString(), 8, 0, ' ')); final int transactionChildCount = row.getChildCount() - ROW_BASE_CHILD_COUNT; int iTransactionView = 0; if (transactions != null) { final String precision = prefs.getString( Constants.PREFS_KEY_BTC_PRECISION, Constants.PREFS_DEFAULT_BTC_PRECISION); final int btcPrecision = precision.charAt(0) - '0'; final int btcShift = precision.length() == 3 ? precision.charAt(2) - '0' : 0; transactionsAdapter.setPrecision(btcPrecision, btcShift); for (final Transaction tx : transactions) { if (tx.getAppearsInHashes().containsKey(header.getHash())) { final View view; if (iTransactionView < transactionChildCount) { view = row.getChildAt(ROW_INSERT_INDEX + iTransactionView); } else { view = getLayoutInflater(null).inflate(R.layout.transaction_row_oneline, null); row.addView(view, ROW_INSERT_INDEX + iTransactionView); } transactionsAdapter.bindView(view, tx); iTransactionView++; } } } final int leftoverTransactionViews = transactionChildCount - iTransactionView; if (leftoverTransactionViews > 0) row.removeViews(ROW_INSERT_INDEX + iTransactionView, leftoverTransactionViews); return row; }
protected static View createMockConnectionView(Context context, MockConnection conn) { // load the ViewGroup from a layout resource. LayoutInflater inflater = LayoutInflater.from(context); ViewGroup root = (ViewGroup) inflater.inflate(R.layout.mock_conn, null); TextView idVal = (TextView) root.findViewById(R.id.val_id); idVal.setText("" + conn.getId()); TextView countVal = (TextView) root.findViewById(R.id.val_count); countVal.setText("" + conn.getUpdateCount()); return root; }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.submission_albumcard, container, false); TextView title = (TextView) rootView.findViewById(R.id.title); TextView desc = (TextView) rootView.findViewById(R.id.desc); title.setText(s.getTitle()); desc.setText( s.getAuthor() + " " + TimeUtils.getTimeAgo(s.getCreated().getTime(), getContext())); ContentType.ImageType type = ContentType.getImageType(s); String url = ""; if (s.getUrl().contains("gallery")) { gallery = true; } list = rootView.findViewById(R.id.images); list.setVisibility(View.VISIBLE); String rawDat = cutEnds(s.getUrl()); String rawdat2 = rawDat; if (rawdat2.substring(rawDat.lastIndexOf("/"), rawdat2.length()).length() < 4) { rawDat = rawDat.replace(rawDat.substring(rawDat.lastIndexOf("/"), rawdat2.length()), ""); } if (!rawDat.isEmpty()) { new AsyncImageLoaderAlbum().execute(getHash(rawDat)); } rootView .findViewById(R.id.base) .setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (Reddit.tabletUI && getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { Intent i2 = new Intent(getActivity(), CommentsScreenPopup.class); i2.putExtra("page", i); (getActivity()).startActivity(i2); } else { Intent i2 = new Intent(getActivity(), CommentsScreen.class); i2.putExtra("page", i); (getActivity()).startActivity(i2); } } }); return rootView; }
protected void initTabs() { Resources res = getResources(); TabHost tabHost = getTabHost(); TabHost.TabSpec spec; Intent intent; // 独自のタブ用レイアウト生成 ViewGroup tabView1 = (ViewGroup) ((LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE)) .inflate(R.layout.tab_view, null); // タブに表示するテキストの設定 TextView text = (TextView) tabView1.findViewById(R.id.tabText); text.setText("デッキ設定"); // TabSpec生成 intent = new Intent().setClass(this, BattleDeckForNormalTab.class); TabSpec tab = tabHost.newTabSpec("tab1").setIndicator(tabView1).setContent(intent); tabHost.addTab(tab); // 独自のタブ用レイアウト生成 ViewGroup tabView2 = (ViewGroup) ((LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE)) .inflate(R.layout.tab_view_special, null); // タブに表示するテキストの設定 TextView text2 = (TextView) tabView2.findViewById(R.id.tabText); text2.setText("特殊カード設定"); // Tab2 intent = new Intent().setClass(this, BattleDeckForSpecialTab.class); spec = tabHost.newTabSpec("tab2").setIndicator(tabView2).setContent(intent); tabHost.addTab(spec); // // Tab1 // intent = new Intent().setClass(this, BattleDeckForNormalTab.class); // spec = tabHost // .newTabSpec("tab1") // .setIndicator("デッキ設定", res.getDrawable(R.drawable.ic_tab_normal)) // .setContent(intent); // tabHost.addTab(spec); // // Tab2 // intent = new Intent().setClass(this, BattleDeckForSpecialTab.class); // spec = tabHost // .newTabSpec("tab2") // .setIndicator("特殊カード設定", res.getDrawable(R.drawable.ic_tab_normal)) // .setContent(intent); // tabHost.addTab(spec); // Set Default Tab - zero based index tabHost.setCurrentTab(0); }
public View getContentView() { if (contentView == null) { contentView = (ViewGroup) lf.inflate(R.layout.bper_payment_recent_detail_page, null); mAccountInfoTitle = (AccountInfoTitle) contentView.findViewById(R.id.account_title_info); mAccountInfoTitle.init(AccountInfoTitle.PAYMENT); page_title = (TextView) contentView.findViewById(R.id.page_title); content_tl = (TableLayout) contentView.findViewById(R.id.table); confirm_btn = (Button) contentView.findViewById(R.id.confirmation_btn); } return contentView; }
public MessagesAdapter(ViewGroup view, BaseActivity activity) { this.activity = activity; currentPage = 0; activity.model.getFriends(activity.util.user.getComboUserID(), currentPage, "GetFriends", this); progress = view.findViewById(R.id.progress); listView = (LoadMoreListView) view.findViewById(R.id.listView); // listView.setOnRefreshListener(this); listView.setOnLoadMoreListener(this); container = view; profiles = new ArrayList<User>(); }
protected void showChangeLogoRem() { if (null == selectLogoDialog) { selectLogoDialog = new Dialog(this, R.style.dialog); ViewGroup mRoot = (ViewGroup) LayoutInflater.from(this).inflate(R.layout.select_photo_dialog_content_view, null); int width = getWindowManager().getDefaultDisplay().getWidth(); selectLogoDialog.setContentView(mRoot, new LayoutParams(width, LayoutParams.WRAP_CONTENT)); Button btnCamera = (Button) mRoot.findViewById(R.id.btnCamera); Button btnAlbum = (Button) mRoot.findViewById(R.id.btnAlbum); Button btnCancel = (Button) mRoot.findViewById(R.id.btnCancel); btnCamera.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { selectLogoDialog.cancel(); // 使用相机拍照 doPickPhotoAction(); } }); btnAlbum.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { selectLogoDialog.cancel(); // 从相册中去获取 try { Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null); intent.setType("image/*"); startActivityForResult(intent, AVATAR_PHOTO_PICKED_WITH_DATA); } catch (ActivityNotFoundException e) { Toast.makeText(HomePageActivity.this, "没有找到照片", Toast.LENGTH_SHORT).show(); } } }); btnCancel.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { selectLogoDialog.cancel(); } }); } Window window = selectLogoDialog.getWindow(); window.setGravity(Gravity.BOTTOM); window.setWindowAnimations(R.style.mystyle); selectLogoDialog.setCanceledOnTouchOutside(true); if (null != selectLogoDialog && !selectLogoDialog.isShowing() && !isFinishing()) { selectLogoDialog.show(); } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_project_description, container, false); projectImage = (ImageView) rootView.findViewById(R.id.projectimage); projectName = (TextView) rootView.findViewById(R.id.projectname); projectStatus = (TextView) rootView.findViewById(R.id.projectstatus); projectDescription = (TextView) rootView.findViewById(R.id.projectdescription); return rootView; }
private void initToolbar(Dialog dialog) { toolBar = (ViewGroup) dialog.findViewById(R.id.zoom_toolbar); toolBar.setVisibility(toolBarVisibility); if (fileUri != null) { Button setAsButton = (Button) toolBar.findViewById(R.id.toolbar_set_as); setAsButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { setImageAsWallpaperPicker(fileUri); } }); } if (contentUri != null) { Button deleteButton = (Button) toolBar.findViewById(R.id.toolbar_delete); deleteButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { String quantityString = getResources().getQuantityString(R.plurals.wallpapers, 1); String title = String.format(getString(R.string.dialog_delete_title), quantityString); FragmentManager fragmentManager = getFragmentManager(); if (fragmentManager != null) { final MaterialDialogFragment materialDialogFragment = new MaterialDialogFragment(); materialDialogFragment.setPrimaryColor( getResources().getColor(R.color.Dialog_Button_Delete)); materialDialogFragment.setTitle(title); materialDialogFragment.setPositiveButton( R.string.dialog_delete_positive, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { delete(contentUri); } }); materialDialogFragment.setNegativeButton( R.string.dialog_delete_negative, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { materialDialogFragment.dismiss(); } }); materialDialogFragment.show(fragmentManager, MaterialDialogFragment.TAG); } } }); } }