本文整理汇总了Java中android.widget.ViewSwitcher.showNext方法的典型用法代码示例。如果您正苦于以下问题:Java ViewSwitcher.showNext方法的具体用法?Java ViewSwitcher.showNext怎么用?Java ViewSwitcher.showNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ViewSwitcher
的用法示例。
在下文中一共展示了ViewSwitcher.showNext方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listSelected
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void listSelected(ListDesc list, boolean animate)
{
//Log.v(L.TAG, "SimplyDoActivity.listSelected() called on list " + list.getId());
setTitle(list.getLabel());
dataViewer.setSelectedList(list);
itemListSorter.sort(dataViewer.getItemData());
itemPropertiesAdapter.notifyDataSetChanged();
ViewSwitcher viewSwitch = (ViewSwitcher)findViewById(R.id.ListsItemsSwitcher);
if(animate)
{
viewSwitch.showNext();
}
else
{
viewSwitch.reset();
viewSwitch.setAnimateFirstView(false);
viewSwitch.setDisplayedChild(1);
}
}
示例2: renameFlow
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
/**
* Hides the Options Menu and uses a ViewSwitcher to quick turn the exisiting TextView with the
* Flow's name into an EditText for the user to rename.
*
* @param cardPosition position of cardview in adapter
* @param cardViewClicked the cardview view object clicked
*/
private void renameFlow(final int cardPosition, final View cardViewClicked) {
menuState = AppConstants.MENU_ITEMS_HIDE;
invalidateOptionsMenu();
final ViewSwitcher switcher = (ViewSwitcher) cardViewClicked.findViewById(R.id.hub_rename_switcher);
final EditText rename = (EditText) switcher.findViewById(R.id.hub_item_flow_rename);
AppUtils.setNameInputFilters(rename);
rename.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (rename.hasFocus()) {
showEditPopupWindow(rename, cardViewClicked, switcher, cardPosition);
}
}
});
switcher.showNext();
rename.requestFocus();
/* Forces keyboard */
}
示例3: renameFlow
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
/**
* Hides the Options Menu and uses a ViewSwitcher to quick turn the exisiting TextView with the
* Flow's name into an EditText for the user to rename.
*
* @param cardPosition position of cardview in adapter
* @param cardViewClicked the cardview view object clicked
*/
private void renameFlow(final int cardPosition, final View cardViewClicked) {
menuState = AppConstants.MENU_ITEMS_HIDE;
invalidateOptionsMenu();
final ViewSwitcher switcher = (ViewSwitcher) cardViewClicked.findViewById(R.id.hub_rename_switcher);
final EditText rename = (EditText) switcher.findViewById(R.id.hub_item_flow_rename);
AppUtils.setNameInputFilters(rename);
rename.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (rename.hasFocus()) {
showEditPopupWindow(rename, cardViewClicked, switcher, cardPosition);
}
}
});
switcher.showNext();
rename.requestFocus();
/* Forces keyboard */
}
示例4: editListName
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
@Override
public void editListName(View _View, ShoppingList _ShoppingList, ViewSwitcher _ViewSwitcher) {
ImageView cancelView;
ImageView submitView;
EditText editText;
cancelView = (ImageView) _View.findViewById(R.id.expandable_list_view_edit_cancel);
submitView = (ImageView) _View.findViewById(R.id.expandable_list_view_edit_submit);
editText = (EditText) _View.findViewById(R.id.expandable_list_view_list_edit_name);
cancelView.setOnClickListener(new OnCancelClickListenerWithData(_ViewSwitcher));
submitView.setOnClickListener(new OnSubmitClickListenerWithChildData(mContext, _ViewSwitcher,
editText, _ShoppingList.mUUID));
editText.setText(_ShoppingList.mName);
_ViewSwitcher.showNext();
}
示例5: setContent
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public void setContent(Fragment content) {
Fragment last = mCurrentContent;
mCurrentContent = content;
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
if (last != null)
ft.replace(R.id.content, mCurrentContent);
else
ft.add(R.id.content, mCurrentContent);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
if (mContainer instanceof ViewSwitcher) {
ViewSwitcher switcher = (ViewSwitcher)mContainer;
if (mContent != switcher.getCurrentView())
switcher.showNext();
}
ft.commit();
}
示例6: switchersShowNext
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void switchersShowNext() {
ViewSwitcher switcherName = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_name);
ViewSwitcher switcherTime = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_time);
ViewSwitcher switcherNotes = (ViewSwitcher) getView().findViewById(R.id.fragment_se_switcher_notes);
switcherName.showNext();
switcherTime.showNext();
switcherNotes.showNext();
}
示例7: showFirstStart
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
private void showFirstStart() {
stopRefreshAnimation();
LayoutInflater inflater = LayoutInflater.from(getActivity());
ViewGroup parent = (ViewGroup) ((ViewGroup) getActivity().findViewById(R.id.scrollview)).getChildAt(0);
if (parent.findViewById(R.id.tracks_msg) == null)
inflater.inflate(R.layout.no_tracks, parent);
TypedValue typedValue = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.firstLaunchCoverDrawable, typedValue, true);
int firstLaunchBGid = typedValue.resourceId;
@SuppressWarnings("deprecation")
BitmapDrawable bd = ((BitmapDrawable) getResources().getDrawable(firstLaunchBGid));
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getActivity());
setCoverArt(bd != null ? bd.getBitmap() : null, null, true);
ViewSwitcher viewSwitcher = getActivity().findViewById(R.id.switcher);
if (viewSwitcher.getChildCount() > 1)
viewSwitcher.removeViewAt(0);
viewSwitcher.addView(new View(getActivity()));
viewSwitcher.showNext();
int themeNum = Integer.valueOf(sharedPref.getString("pref_theme", "0"));
if (themeNum > 0 && themeNum != 7) {
TypedValue darkColorValue = new TypedValue();
getActivity().getTheme().resolveAttribute(R.attr.colorPrimaryDark, darkColorValue, true);
((FadeInNetworkImageView) getActivity().findViewById(R.id.cover))
.setColorFilter(darkColorValue.data, PorterDuff.Mode.OVERLAY);
}
getActivity().findViewById(R.id.error_msg).setVisibility(View.INVISIBLE);
((TextView) getActivity().findViewById(R.id.artist)).setText("");
((TextView) getActivity().findViewById(R.id.song)).setText("");
getActivity().findViewById(R.id.top_gradient).setVisibility(View.INVISIBLE);
getActivity().findViewById(R.id.bottom_gradient).setVisibility(View.INVISIBLE);
getActivity().findViewById(R.id.edit_tags_btn).setVisibility(View.INVISIBLE);
}
示例8: onCreate
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.request_grid);
switcherLoad = (ViewSwitcher)findViewById(R.id.viewSwitcherLoadingMain);
context = this;
getActionBar().setDisplayHomeAsUpEnabled(true);
if(savedInstanceState == null){
//Loading Logo Animation
ImageView logo = (ImageView)findViewById(R.id.imageViewLogo);
ObjectAnimator logoAni = (ObjectAnimator)AnimatorInflater.loadAnimator(context, R.animator.request_flip);
logoAni.setRepeatCount(Animation.INFINITE);
logoAni.setRepeatMode(Animation.RESTART);
logoAni.setTarget(logo);
logoAni.setDuration(2000);
logoAni.start();
taskList.execute();
}
else
{
populateView(list_activities_final);
switcherLoad.showNext();
}
}
示例9: onObjectUpdated
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public void onObjectUpdated() {
Log.i(TAG, "Object " + m_id + " updated");
View rootView = getView();
if(rootView != null) {
ViewSwitcher sw = (ViewSwitcher) getView().findViewById(R.id.switcher);
if(m_child != null) {
if(sw.getCurrentView().getId() != R.id.objectDisplayFragment)
sw.showNext();
// Notify the child
m_child.objectUpdated(m_object);
return;
}
// Construct the child fragment
ObjectFragment frag = null;
if(m_object == null) {
frag = new NullObjectFragment();
} else if("person".equals(m_object.optString("objectType"))) {
frag = new PersonObjectFragment();
} else {
frag = new StandardObjectFragment();
}
FragmentManager mgr = getChildFragmentManager();
m_child = ObjectFragment.prepare(frag, m_id, m_intId);
mgr.beginTransaction()
.add(R.id.objectDisplayFragment, m_child)
.commit();
sw.showNext();
} else {
// Nothing to do - our UI hasn't yet been created
// We will update when we have a child
}
}
示例10: do_flip
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public void do_flip (View view)
{
ViewSwitcher vs_buttonrow = (ViewSwitcher) findViewById(R.id.vs_buttonrow);
vs_buttonrow.showNext();
ViewSwitcher vs_cardsides = (ViewSwitcher) findViewById(R.id.vs_cardsides);
vs_cardsides.showNext();
}
示例11: editUserName
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public void editUserName(View v) {
ViewSwitcher switcher = (ViewSwitcher) findViewById(R.id.username_switcher);
switcher.showNext();
editUserName(switcher.getDisplayedChild() == 1);
}
示例12: onCreateView
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.fragment_add_note, container, false);
notePreview = (TextView) rootView.findViewById(R.id.add_note_preview);
// ViewGroup.LayoutParams maxParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
// noteEdit = new EditText(getActivity());
// notePreview = new EditText(getActivity());
// noteEdit.setLayoutParams(maxParams);
// notePreview.setLayoutParams(maxParams);
// notePreview.setClickable(true);
// notePreview.setOnClickListener(this);
// noteEdit.setId(R.id.note_view_edit);
// notePreview.setId(R.id.note_view_preview);
noteEdit = (EditText) rootView.findViewById(R.id.add_note_edit);
noteDate = (TextView) rootView.findViewById(R.id.add_note_date);
fillFromNote(shownNote);
switcher = (ViewSwitcher) rootView.findViewById(R.id.switcher);
// switcher.addView(noteEdit);
// switcher.addView(notePreview);
if(viewType == TYPE_PREVIEW)
{
// switcher.showPrevious();
}
else
{
switcher.showNext();
}
activityCommunicator.onMessage(REQUEST_CHANGE_TYPE, viewType);
notePreview.setText(shownNote.getContent());
if(Utils.isDateToday(shownNote.getLastModified()))
{
noteDate.setText(
getString(R.string.today_capital)
);
}
else if(Utils.isDateToday(shownNote.getLastModified()))
{
noteDate.setText(
getString(R.string.yesterday_capital)
);
}
else
{
Date lastModifiedDate = new Date((long)shownNote.getLastModified()*1000);
Calendar lastModifiedCalendar = Calendar.getInstance();
lastModifiedCalendar.setTime(lastModifiedDate);
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, MMM d, yyyy HH:mm");
noteDate.setText(
dateFormat.format(new Date(((long)shownNote.getLastModified()*1000))));
}
return rootView;
}
示例13: updateList
import android.widget.ViewSwitcher; //导入方法依赖的package包/类
public void updateList() {
progressContainer = findViewById(R.id.progress_bar_container);
progressBar = (ProgressBar)findViewById(R.id.analyze_progress);
progressContainer.setVisibility(View.GONE);
loadText = (TextView) findViewById(R.id.load_text);
TextView stopScan = (TextView) findViewById(R.id.stop_scan);
Typeface font = Typeface.createFromAsset(getAssets(), "fontawesome-webfont.ttf");
stopScan.setTypeface(font);
stopScan.setClickable(true);
stopScan.setOnClickListener(this);
startScan = (Button) findViewById(R.id.start_scan);
startScan.setOnClickListener(this);
ViewSwitcher switcher = (ViewSwitcher)findViewById(R.id.switcher);
ViewSwitcher switcher_list = (ViewSwitcher)findViewById(R.id.switcher_list);
Context context = getApplicationContext();
File path = context.getDatabasePath("contactsgraph");
File modelFile = new File(path, "model.kryo.gz");
if (path.exists() && modelFile.exists()) {
this.adapter.update();
while (switcher.getCurrentView().getId() != R.id.switcher_list) {
switcher.showNext();
}
if (adapter.getCount() == 0) {
while (switcher_list.getCurrentView().getId() != R.id.all_done) {
switcher_list.showNext();
}
} else {
while (switcher_list.getCurrentView().getId() != R.id.contact_merge_list) {
switcher_list.showPrevious();
}
}
switcher_list.postInvalidate();
} else {
if (switcher.getCurrentView().getId() == R.id.contact_merge_list) {
switcher.showPrevious();
}
Intent intent = new Intent(getApplicationContext(), AnalyzerService.class);
intent.putExtra("forceRunning", true);
startService(intent);
}
switcher.postInvalidate();
}