Java Code Examples for android.widget.ViewFlipper

The following are top voted examples for showing how to use android.widget.ViewFlipper. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: XERUNG   File: AddNewGroup.java   View source code 6 votes vote down vote up
private void findViewIds(){
	mLayback = (RelativeLayout)findViewById(R.id.layBack);
	mTxtHead = (TextView)findViewById(R.id.txtHead);
	mTxtHead.setTypeface(android);
	mTxtNote = (TextView)findViewById(R.id.txtNote);
	mTxtNote.setTypeface(roboto);
	mBtnNext = (ButtonFlat)findViewById(R.id.btnNextOk);
	mBtnDone = (TextView)findViewById(R.id.btnDone);
	mBtnDone.setTypeface(roboto);
	mEdtGroupName = (MaterialEditText)findViewById(R.id.edtGroupName);
	mEdtGroupName.setTypeface(roboto);
	mEdtTagLine = (MaterialEditText)findViewById(R.id.edtTagName);
	mEdtTagLine.setTypeface(roboto);
	mEdtGroupDesc = (MaterialEditText)findViewById(R.id.edtDescName);
	mEdtGroupDesc.setTypeface(roboto);
	mImgGroupPhoto = (CircleImageView)findViewById(R.id.imgProfilePicSet);
	mEdtSerachContact = (MaterialEditText)findViewById(R.id.edtContactSearch);
	mEdtSerachContact.setTypeface(roboto);
	mListSearch = (ListView)findViewById(R.id.lvContactListSearch);
	vw1 = (ViewFlipper)findViewById(R.id.vw1);
	vw2 = (ViewFlipper)findViewById(R.id.vw2);
	txtNoData = (TextView)findViewById(R.id.txtNoSearchresult);
	txtNoData.setTypeface(roboto);
}
 
Example 2
Project: XERUNG   File: AddNewGroup.java   View source code 6 votes vote down vote up
private void findViewIds(){
	mLayback = (RelativeLayout)findViewById(R.id.layBack);
	mTxtHead = (TextView)findViewById(R.id.txtHead);
	mTxtHead.setTypeface(android);
	mTxtNote = (TextView)findViewById(R.id.txtNote);
	mTxtNote.setTypeface(roboto);
	mBtnNext = (ButtonFlat)findViewById(R.id.btnNextOk);
	mBtnDone = (TextView)findViewById(R.id.btnDone);
	mBtnDone.setTypeface(roboto);
	mEdtGroupName = (MaterialEditText)findViewById(R.id.edtGroupName);
	mEdtGroupName.setTypeface(roboto);
	mEdtTagLine = (MaterialEditText)findViewById(R.id.edtTagName);
	mEdtTagLine.setTypeface(roboto);
	mEdtGroupDesc = (MaterialEditText)findViewById(R.id.edtDescName);
	mEdtGroupDesc.setTypeface(roboto);
	mImgGroupPhoto = (CircleImageView)findViewById(R.id.imgProfilePicSet);
	mEdtSerachContact = (MaterialEditText)findViewById(R.id.edtContactSearch);
	mEdtSerachContact.setTypeface(roboto);
	mListSearch = (ListView)findViewById(R.id.lvContactListSearch);
	vw1 = (ViewFlipper)findViewById(R.id.vw1);
	vw2 = (ViewFlipper)findViewById(R.id.vw2);
	txtNoData = (TextView)findViewById(R.id.txtNoSearchresult);
	txtNoData.setTypeface(roboto);
}
 
Example 3
Project: EmoticonGIFKeyboard   File: EmoticonGridFragment.java   View source code 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ViewFlipper mainViewFlipper = view.findViewById(R.id.recent_emoticon_flipper);

    List<Emoticon> emoticonList = getEmoticonsList(getArguments().getInt(ARG_CATEGORY_ID, -1));

    if (emoticonList.isEmpty()) {
        mainViewFlipper.setDisplayedChild(1);
    } else {
        mainViewFlipper.setDisplayedChild(0);

        GridView emoticonGrid = view.findViewById(R.id.emoticon_list_grid);
        emoticonGrid.setNumColumns(getResources().getInteger(R.integer.emoticon_recycler_view_span_size));
        emoticonGrid.setOnItemClickListener(this);

        //Bind the adapter
        //noinspection WrongConstant
        EmoticonGridAdapter emoticonGridAdapter = new EmoticonGridAdapter(getActivity(),
                mEmoticonProvider, emoticonList);
        emoticonGrid.setAdapter(emoticonGridAdapter);
    }
}
 
Example 4
Project: orgzly-android   File: BookFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, inflater, container, savedInstanceState);

    View view = inflater.inflate(R.layout.fragment_book, container, false);

    final ListView listView = (ListView) view.findViewById(android.R.id.list);
    // setupGestureDetector(listView);
    mHeader = inflater.inflate(R.layout.item_head_book_preface, listView, false);

    mPrefaceText = (TextView) mHeader.findViewById(R.id.fragment_book_header_text);
    if (getActivity() != null && AppPreferences.isFontMonospaced(getContext())) {
        mPrefaceText.setTypeface(Typeface.MONOSPACE);
    }

    mViewFlipper = (ViewFlipper) view.findViewById(R.id.fragment_book_view_flipper);

    /* Big new note button when there are no notes. */
    mNoNotesText = view.findViewById(R.id.fragment_book_no_notes);

    return view;
}
 
Example 5
Project: orgzly-android   File: ReposFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_repos, container, false);

    mViewFlipper = (ViewFlipper) view.findViewById(R.id.fragment_repos_flipper);

    /* Hide or setup new Dropbox repo button. */
    View newDropboxRepoButton = view.findViewById(R.id.fragment_repos_dropbox);
    if (BuildConfig.IS_DROPBOX_ENABLED) {
        newDropboxRepoButton.setOnClickListener(v -> mListener.onRepoNewRequest(R.id.repos_options_menu_item_new_dropbox));
    } else {
        newDropboxRepoButton.setVisibility(View.GONE);
    }

    view.findViewById(R.id.fragment_repos_directory).setOnClickListener(v ->
            mListener.onRepoNewRequest(R.id.repos_options_menu_item_new_external_storage_directory));

    return view;
}
 
Example 6
Project: orgzly-android   File: GesturedListViewItemMenu.java   View source code 6 votes vote down vote up
public void updateView(ViewGroup menuContainer, ViewFlipper menuFlipper) {
        /* Update current menu views for the item. */
        containerView = menuContainer;
        flipperView = menuFlipper;

        /* Update container. */
        switch (containerState) {
            case OPENED:
                    /* Update flipper. */
//                    menu.flipperView.setInAnimation(null);
//                    menu.flipperView.setOutAnimation(null);
                flipIfNeeded(flipperDisplayedChild);
                containerView.setVisibility(View.VISIBLE);
                break;

            case OPENING:
                break;

            case CLOSED:
                containerView.setVisibility(View.GONE);
                break;

            case CLOSING:
                break;
        }
    }
 
Example 7
Project: orgzly-android   File: GesturedListViewItemMenus.java   View source code 6 votes vote down vote up
/**
 * Called when binding views from the adapter.
 */
public void updateView(View view, long noteId, ViewGroup menuContainer, ViewFlipper menuFlipper) {
    GesturedListViewItemMenu menu = openedMenus.get(noteId);

    if (menu == null) {
        menuContainer.setVisibility(View.GONE);

    } else {
        if (menu.isClosed()) {
            openedMenus.delete(noteId);

        } else {
            menu.updateView(menuContainer, menuFlipper);

            // view.setBackgroundResource(R.color.item_head_menu_opened);
            setItemMenuButtonOnClickListeners(view, noteId);
        }
    }
}
 
Example 8
Project: anitrend-app   File: SeriesReviewAdapter.java   View source code 6 votes vote down vote up
CardViewHolder(View view) {
    super(view);
    mUpFlipper = (ViewFlipper) view.findViewById(R.id.mUpFlipper);
    mDownFlipper = (ViewFlipper) view.findViewById(R.id.mDownFlipper);
    user_name = (TextView) view.findViewById(R.id.review_user_name);
    review_date = (TextView) view.findViewById(R.id.review_date);
    review_summary = (TextView) view.findViewById(R.id.review_summary);
    review_up_score = (TextView) view.findViewById(R.id.review_up_score);
    review_down_score = (TextView) view.findViewById(R.id.review_down_score);
    review_rating = (RatingBar) view.findViewById(R.id.review_rating);
    user_image = (CircleImageView) view.findViewById(R.id.review_user_image);
    review_card = (CardView) view.findViewById(R.id.card_review);
    review_read_more = (TextView) view.findViewById(R.id.review_read_more);
    /*onClickListeners*/
    user_image.setOnClickListener(this);
    review_read_more.setOnClickListener(this);
    review_card.setOnClickListener(this);
    mUpFlipper.setOnClickListener(this);
    mDownFlipper.setOnClickListener(this);
}
 
Example 9
Project: anitrend-app   File: CommentAdapter.java   View source code 6 votes vote down vote up
ViewHolder(View view) {
    super(view);
    mLikesViewer = view.findViewById(R.id.likes_viewer);
    mPostContainer = view.findViewById(R.id.post_extra_holder);
    mFlipper = (ViewFlipper) view.findViewById(R.id.mFlipper);
    mAvatar = (ImageView) view.findViewById(R.id.post_avatar);
    mPostExtra = (ImageView) view.findViewById(R.id.post_extra_img);
    mTime = (TextView) view.findViewById(R.id.post_time);
    mUsername = (TextView) view.findViewById(R.id.post_user_name);
    mContent = (TextView) view.findViewById(R.id.post_text);
    mLike = (TextView) view.findViewById(R.id.post_like);
    mReply = (TextView) view.findViewById(R.id.post_reply);
    mEdit = (TextView) view.findViewById(R.id.post_edit);
    mDelete = (TextView) view.findViewById(R.id.post_delete);
    mGallery = (TextView) view.findViewById(R.id.post_extra_img_gallery) ;
    mContent.setMovementMethod(LinkMovementMethod.getInstance());
    mContent.setFocusable(false);
    mLikesViewer.setOnClickListener(this);
    mFlipper.setOnClickListener(this);
    mReply.setOnClickListener(this);
    mEdit.setOnClickListener(this);
    mDelete.setOnClickListener(this);
    mAvatar.setOnClickListener(this);
    mPostExtra.setOnClickListener(this);
    mGallery.setOnClickListener(this);
}
 
Example 10
Project: boohee_v5.6   File: TopicActivity$$ViewInjector.java   View source code 6 votes vote down vote up
public void inject(Finder finder, final T target, Object source) {
    target.frameContent = (FrameLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.frame_content, "field 'frameContent'"), R.id.frame_content, "field " +
            "'frameContent'");
    target.ivTop = (ImageView) finder.castView((View) finder.findRequiredView(source, R.id
            .iv_top, "field 'ivTop'"), R.id.iv_top, "field 'ivTop'");
    target.viewTabs = (TabLayout) finder.castView((View) finder.findRequiredView(source, R.id
            .view_tabs, "field 'viewTabs'"), R.id.view_tabs, "field 'viewTabs'");
    target.headerLayout = (LinearLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.header_layout, "field 'headerLayout'"), R.id.header_layout, "field " +
            "'headerLayout'");
    target.layout = (TouchCallbackLayout) finder.castView((View) finder.findRequiredView
            (source, R.id.layout, "field 'layout'"), R.id.layout, "field 'layout'");
    View view = (View) finder.findRequiredView(source, R.id.fab_button, "field 'fabButton' " +
            "and method 'onClick'");
    target.fabButton = (FloatingActionButton) finder.castView(view, R.id.fab_button, "field " +
            "'fabButton'");
    view.setOnClickListener(new DebouncingOnClickListener() {
        public void doClick(View p0) {
            target.onClick(p0);
        }
    });
    target.vfNotice = (ViewFlipper) finder.castView((View) finder.findRequiredView(source, R
            .id.vf_notice, "field 'vfNotice'"), R.id.vf_notice, "field 'vfNotice'");
}
 
Example 11
Project: boohee_v5.6   File: PasscodeActivity.java   View source code 6 votes vote down vote up
private void init() {
    this.passcodeView1 = (PasscodeView) findViewById(R.id.passcode_view1);
    this.passcodeView2 = (PasscodeView) findViewById(R.id.passcode_view2);
    this.viewFlipper = (ViewFlipper) findViewById(R.id.view_flipper);
    this.passcodeView1.setOnPasswordCompleteListener(new OnPasswordCompleteListener() {
        public void onPasswordComplete(String password) {
            if (PasscodeActivity.ACTION_PASSWORD_OPEN.equals(PasscodeActivity.this.action)) {
                PasscodeActivity.this.setPasswordOpen(password);
            } else if (PasscodeActivity.ACTION_PASSWORD_CLOSE.equals(PasscodeActivity.this
                    .action)) {
                PasscodeActivity.this.setPasswordClose(password);
            } else if (PasscodeActivity.ACTION_PASSWORD_INPUT.equals(PasscodeActivity.this
                    .action)) {
                PasscodeActivity.this.setPasswordInput(password);
            }
        }
    });
}
 
Example 12
Project: sealtalk-android-master   File: BaseActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setContentView(R.layout.layout_base);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
    mContext = this;

    // 初始化公共头部
    mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
    mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
    mHeadRightText = (TextView) findViewById(R.id.text_right);
    mBtnLeft = (Button) super.findViewById(R.id.btn_left);
    mBtnRight = (Button) super.findViewById(R.id.btn_right);
    mTitle = (TextView) super.findViewById(R.id.tv_title);
    mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
    mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
    mBtnBackDrawable.getMinimumHeight());


    mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
    // Activity管理
    action = new SealAction(mContext);
}
 
Example 13
Project: phonk   File: WelcomeActivity.java   View source code 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.welcome_activity);
    setupActivity();

    viewFlipper = (ViewFlipper) findViewById(R.id.viewFlipper);
    viewFlipper.setInAnimation(this, R.anim.slide_in_left);
    viewFlipper.setOutAnimation(this, R.anim.slide_out_right);

    mNextStepButton = (Button) findViewById(R.id.next_step_button);
    mNextStepButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            goToStep(mNextStep);
        }
    });
    mLoading = (LinearLayout) findViewById(R.id.loading);

    goToStep(STEP_WELCOME);
}
 
Example 14
Project: rongyunDemo   File: BaseActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setContentView(R.layout.layout_base);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
    mContext = this;

    // 初始化公共头部
    mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
    mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
    mHeadRightText = (TextView) findViewById(R.id.text_right);
    mBtnLeft = (Button) super.findViewById(R.id.btn_left);
    mBtnRight = (Button) super.findViewById(R.id.btn_right);
    mTitle = (TextView) super.findViewById(R.id.tv_title);
    mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
    mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
                               mBtnBackDrawable.getMinimumHeight());


    mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
    // Activity管理
    action = new SealAction(mContext);

}
 
Example 15
Project: ImageClassify   File: TagImagePresenter.java   View source code 6 votes vote down vote up
@Override
public void prevView(ViewFlipper taskViewFlipper, TextView prevImgBtn, TextView nextImgBtn) {
    taskViewFlipper.setInAnimation(mContext, R.anim.left_in);
    taskViewFlipper.setOutAnimation(mContext, R.anim.left_out);
    if (taskViewFlipper.getDisplayedChild() != 0) {
        //上一张图
        taskViewFlipper.showPrevious();
        if (taskViewFlipper.getDisplayedChild() == 0) {
            prevImgBtn.setText(R.string.str_no);
            nextImgBtn.setText(R.string.str_next_ques);
        } else {
            prevImgBtn.setText(R.string.str_previous_ques);
            nextImgBtn.setText(R.string.str_next_ques);
        }
    } else {
        prevImgBtn.setText(R.string.str_no);
        nextImgBtn.setText(R.string.str_next_ques);
    }
}
 
Example 16
Project: ImageClassify   File: TagImagePresenter.java   View source code 6 votes vote down vote up
@Override
public void nextView(ViewFlipper taskViewFlipper, TextView prevImgBtn, TextView nextImgBtn) {
    taskViewFlipper.setInAnimation(mContext, R.anim.right_in);
    taskViewFlipper.setOutAnimation(mContext, R.anim.right_out);
    if (taskViewFlipper.getDisplayedChild() != mTaskAmount) {
        taskViewFlipper.showNext();
        if (taskViewFlipper.getDisplayedChild() == mTaskAmount) {
            //最后一页结果页
            updateTagResult(taskViewFlipper, mTagResultGridView, mFinishProgressTv, getFinishedAmount());
        } else {
            prevImgBtn.setText(R.string.str_previous_ques);
            nextImgBtn.setText(R.string.str_next_ques);
        }
    } else {
        Log.d(TAG, "nextView: 结果页 " + getFinishedAmount());
        //最后一页结果页
        updateTagResult(taskViewFlipper, mTagResultGridView, mFinishProgressTv, getFinishedAmount());
    }
}
 
Example 17
Project: YFHR_Android_App   File: HomeFragment.java   View source code 6 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
       View view =inflater.inflate(R.layout.fragment_home, container, false);
        viewFlipper = (ViewFlipper) view.findViewById(R.id.flipper);
        fade_in = AnimationUtils.loadAnimation(getContext(),
                android.R.anim.fade_in);
        fade_out = AnimationUtils.loadAnimation(getContext(),
                android.R.anim.fade_out);
        viewFlipper.setInAnimation(fade_in);
        viewFlipper.setOutAnimation(fade_out);
//sets auto flipping
        viewFlipper.setAutoStart(true);
        viewFlipper.setFlipInterval(3000);
        viewFlipper.startFlipping();
        return view;
    }
 
Example 18
Project: OwnTrack   File: PreferencesView.java   View source code 6 votes vote down vote up
public PreferenceView(Preferences.Item preferenceItem) {
    this.preferenceItem = preferenceItem;

    /* The main component of a PreferenceView is this ViewFlipper which holds all possible values */
    viewFlipper = new ViewFlipper(context);
    /* A wrapper to show additional information like descriptions */
    preferenceView = new FrameLayout(context);

    /* The overlay holds all additional information */
    loadOverlay();
    /* Load all values from which the user can choose */
    loadPossibleValues();
    /* Set the actions to perform on click (and touch) */
    setOnClick();
    /* Load the current active settings */
    loadCurrentSettings();

    /* Add the the main view, which holds all values */
    preferenceView.addView(viewFlipper);
    /* Add the overlays to the PreferenceView */
    preferenceView.addView(recommendedSettingLabel);
    preferenceView.addView(headerLabel);
    preferenceView.addView(footerLabel);
    /* Initialize scrollbar which indicates the position of the current value */
    preferenceView.addView(createScrollBar());
}
 
Example 19
Project: RongCloudJcenter   File: BaseActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setContentView(R.layout.layout_base);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
    mContext = this;

    // 初始化公共头部
    mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
    mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
    mHeadRightText = (TextView) findViewById(R.id.text_right);
    mBtnLeft = (Button) super.findViewById(R.id.btn_left);
    mBtnRight = (Button) super.findViewById(R.id.btn_right);
    mTitle = (TextView) super.findViewById(R.id.tv_title);
    mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
    mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
                               mBtnBackDrawable.getMinimumHeight());


    mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
    // Activity管理
    action = new SealAction(mContext);

}
 
Example 20
Project: faveo-helpdesk-android-app   File: LoginActivity.java   View source code 6 votes vote down vote up
private void setUpViews() {
    progressDialogVerifyURL = new ProgressDialog(this);
    progressDialogVerifyURL.setMessage("Verifying URL");
    progressDialogVerifyURL.setCancelable(false);

    progressDialogSignIn = new ProgressDialog(this);
    progressDialogSignIn.setMessage("Signing in");
    progressDialogSignIn.setCancelable(false);

    editTextCompanyURL = (EditText) findViewById(R.id.editText_company_url);
    if (editTextCompanyURL != null) {
        editTextCompanyURL.setText("http://");
    }
    viewflipper = (ViewFlipper) findViewById(R.id.viewFlipper);
    buttonVerifyURL = (ImageButton) findViewById(R.id.imageButton_verify_url);
    textViewFieldError = (TextView) findViewById(R.id.textView_field_error);
    textViewForgotPassword = (TextView) findViewById(R.id.forgot_password);
    editTextUsername = (EditText) findViewById(R.id.editText_username);
    editTextPassword = (EditText) findViewById(R.id.editText_password);
    buttonSignIn = (Button) findViewById(R.id.button_sign_in);
    paddingTop = editTextUsername.getPaddingTop();
    paddingBottom = editTextUsername.getPaddingBottom();

}
 
Example 21
Project: ImageSwitcher   File: PictureShowDialog.java   View source code 6 votes vote down vote up
/**
 * 构造函数
 * @author leibing
 * @createTime 2016/08/24
 * @lastModify 2016/08/24
 * @param context 上下文
 * @return
 */
public PictureShowDialog(Context context) {
    super(context, android.R.style.Theme);
    // 设置窗体无标题样式d
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    // 隐藏状态栏
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    // 设定布局
    setContentView(R.layout.dialog_picture_show);
    // FindView
    mDialogPictureVf = (ViewFlipper) findViewById(R.id.vf_dialog_picture);
    mIndicatorsLy = (LinearLayout) findViewById(R.id.ly_indicators);
    // 初始化手势
    detector = new GestureDetector(this);
    // 动画效果
    leftInAnimation = AnimationUtils.loadAnimation(context, R.anim.left_in);
    leftOutAnimation = AnimationUtils.loadAnimation(context, R.anim.left_out);
    rightInAnimation = AnimationUtils.loadAnimation(context, R.anim.right_in);
    rightOutAnimation = AnimationUtils.loadAnimation(context, R.anim.right_out);
}
 
Example 22
Project: foursquared   File: CategoryPickerDialog.java   View source code 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.category_picker_dialog);
    setTitle(getContext().getResources().getString(R.string.category_picket_dialog_title));
    
    mViewFlipper = (ViewFlipper) findViewById(R.id.categoryPickerViewFlipper);

    mFirstDialogHeight = -1;

    // By default we always have a top-level page.
    Category root = new Category();
    root.setNodeName("root");
    root.setChildCategories(mCategories);

    mViewFlipper.addView(makePage(root));
}
 
Example 23
Project: HorseandRidersCompanion   File: MainActivity.java   View source code 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    activityComponent().inject(this);

    mPresenter.attachView(this);
    mPresenter.getRiderProfile(getIntent().getStringExtra(EMAIL));

    horseList = (ListView) findViewById(R.id.horses_list);
    horseList.setOnItemClickListener((adapterView, view, i, l) -> onHorseSelected(i));
    horseList.setOnItemLongClickListener((adapterView, view, i, l) -> onHorseLongClicked(i));
    TextView emptyList = (TextView) findViewById(R.id.empty_horse_list);
    emptyList.setOnClickListener(view -> emptyHorseListClicked());
    AppCompatButton skillTreeButton = (AppCompatButton) findViewById(R.id.button_skill_tree);
    skillTreeButton.setOnClickListener(view -> openSkillTree());
    AppCompatButton addHorseButton = (AppCompatButton) findViewById(R.id.add_horse_button);
    addHorseButton.setOnClickListener(view -> addHorseClicked());
    viewFlipperHorse = (ViewFlipper) findViewById(R.id.owned_horses_view_flipper);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_hnr);
    setSupportActionBar(toolbar);
    toolbar.setTitle(riderProfile.getName());
    setupToolbar(toolbar);

    setUpNavigationDrawer();
}
 
Example 24
Project: LS-jsampler   File: MainFrame.java   View source code 6 votes vote down vote up
@Override
public void
onCreate() {
	LayoutInflater inflater =
		(LayoutInflater)AHF.getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	view = inflater.inflate(R.layout.classic_main, null);
	
	ChannelLanesPagerAdapter lanesPagerAdapter = new ChannelLanesPagerAdapter();
	lanesPager = (ViewPager)view.findViewById(R.id.main_channel_lane_pager);
	lanesPager.setAdapter(lanesPagerAdapter);

	panesFlipper = (ViewFlipper)view.findViewById(R.id.main_flipper);
	panesFlipper.setDisplayedChild(1);
	updateMainTitle();
	
	installListeners();
	updateVolume();
	
	ChannelsPane cp = new ChannelsPane();
	cp.setTitle("Channel Lane 1");
	addChannelsPane(cp);
	
	addChannelsPane(new ChannelsPane("Channel Lane 2"));
	setSelectedChannelsPane(cp);
}
 
Example 25
Project: sealtalk-android   File: BaseActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setContentView(R.layout.layout_base);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);// 使得音量键控制媒体声音
    mContext = this;

    // 初始化公共头部
    mContentView = (ViewFlipper) super.findViewById(R.id.layout_container);
    mHeadLayout = (LinearLayout) super.findViewById(R.id.layout_head);
    mHeadRightText = (TextView) findViewById(R.id.text_right);
    mBtnLeft = (Button) super.findViewById(R.id.btn_left);
    mBtnRight = (Button) super.findViewById(R.id.btn_right);
    mTitle = (TextView) super.findViewById(R.id.tv_title);
    mBtnBackDrawable = getResources().getDrawable(R.drawable.ac_back_icon);
    mBtnBackDrawable.setBounds(0, 0, mBtnBackDrawable.getMinimumWidth(),
                               mBtnBackDrawable.getMinimumHeight());


    mAsyncTaskManager = AsyncTaskManager.getInstance(getApplicationContext());
    // Activity管理
    action = new SealAction(mContext);

}
 
Example 26
Project: TapsOfFire   File: UIHelpers.java   View source code 6 votes vote down vote up
public static void flipToChild(Activity activity,int flipperID,int child,boolean animate) {
	ViewFlipper flipper=(ViewFlipper)activity.findViewById(flipperID);
	Animation in=null;
	Animation out=null;
	if (!animate) {
		in=flipper.getInAnimation();
		out=flipper.getOutAnimation();
		flipper.setInAnimation(null);
		flipper.setOutAnimation(null);
	}
	flipper.getChildAt(child).setVisibility(View.VISIBLE);
	flipper.setDisplayedChild(child);
	if (!animate) {
		flipper.setInAnimation(in);
		flipper.setOutAnimation(out);
	}
}
 
Example 27
Project: jour-et-nuit   File: SearchBandActivity.java   View source code 6 votes vote down vote up
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_band);

        ViewFlipper vf = (ViewFlipper)findViewById(R.id.flipper);
/*        mSearchView = getLayoutInflater().inflate(R.layout.search_scan, null);

        ImageView miliImage = (ImageView)mSearchView.findViewById(R.id.mili_image);
        Animation fadeAnim = new AlphaAnimation(0.5f, 1.0f);
        fadeAnim.setDuration(750);
        fadeAnim.setRepeatMode(Animation.REVERSE);
        fadeAnim.setRepeatCount(Animation.INFINITE);
        miliImage.startAnimation(fadeAnim);

        vf.addView(mSearchView, STATE_SEARCH_DEVICE);
*/

        mConfigView = getLayoutInflater().inflate(R.layout.search_profile, null);

        vf.addView(mConfigView);

        // get the bluetooth manager
        btManager = (BluetoothManager)getSystemService(BLUETOOTH_SERVICE);
        btManager.getAdapter().startLeScan(scanCallback);
    }
 
Example 28
Project: sealnote   File: RestoreActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_restore);

    mFlipper =  (ViewFlipper) findViewById(R.id.restore_flipper);
    mRestoreButton = findViewById(R.id.restore_button);
    mRestoreProgress = findViewById(R.id.restore_progress);
    mPasswordInput = (EditText) findViewById(R.id.input_password);

    // Setup flipper animations
    Animation animationFlipIn  = AnimationUtils.loadAnimation(this, R.anim.flipin);
    Animation animationFlipOut = AnimationUtils.loadAnimation(this, R.anim.flipout);

    mFlipper.setInAnimation(animationFlipIn);
    mFlipper.setOutAnimation(animationFlipOut);

    setupMessages();
    setupCheckCallbackup();
}
 
Example 29
Project: order_dish   File: MainActivity.java   View source code 6 votes vote down vote up
/**
 * �������� : initComponent �������� : ����������ֵ˵����
 *
 * 
 */
private void initComponent() {

	mViewFilpper = (ViewFlipper) findViewById(R.id.view_flipper);

	// ��̬����ķ�ʽΪViewFlipper������view
	for (int i = 0; i < mFlipperArray.length; i++) {
		mViewFilpper.addView(getView(mFlipperArray[i]));
	}

	// ���ö���Ч��
	mViewFilpper.setInAnimation(this, R.anim.right_in);
	mViewFilpper.setOutAnimation(this, R.anim.right_out);

	// �趨ViewFlipper��ͼ�л�ʱ����
	mViewFilpper.setFlipInterval(4000);

	// ����ViewFlipper����ʼ����
	mViewFilpper.setAutoStart(true);

	if (mViewFilpper.isAutoStart() && !mViewFilpper.isFlipping()) {
		mViewFilpper.startFlipping();
	}

}
 
Example 30
Project: eDao   File: Fragment_Home.java   View source code 6 votes vote down vote up
private void init() {
	// TODO 自动生成的方法存根
	flipper = (ViewFlipper) getView().findViewById(R.id.fragment_home_viewFlipper);
	textView_inform = (TextView) getView().findViewById(R.id.main_textView_inform);
	textView_ecoin = (TextView) getView().findViewById(R.id.main_textView_ecoin);
	textView_goldcoin = (TextView) getView().findViewById(R.id.main_textView_goldcoin);
	textView_point = (TextView) getView().findViewById(R.id.main_textView_point);
	layout_user = (LinearLayout) getView().findViewById(R.id.main_layout_user);
	layout_map = (LinearLayout) getView().findViewById(R.id.main_layout_map);
	textView_indicator = (TextView) getView().findViewById(R.id.fragment_home_indicator);
	gridView = (GridView) getView().findViewById(R.id.main_gridView);

	gridViewAdapter = new Fragment_Home_GridViewAdapter(getActivity(), list_name, list_image, gridView);
	gridView.setAdapter(gridViewAdapter);
	gridView.setOnItemClickListener(this);

	sidebar = NavigationActivity.sideBar;
	radioButton_shop = (RadioButton) NavigationActivity.radioButton_shop;

	layout_user.setOnClickListener(this);
	layout_map.setOnClickListener(this);
	textView_inform.setOnClickListener(this);
}
 
Example 31
Project: eDao   File: Fragment_Store.java   View source code 6 votes vote down vote up
private void init() {
	// TODO 自动生成的方法存根
	textView_indicator = (TextView) getView().findViewById(R.id.fragment_store_indicator);
	textView_curCity = (TextView) getView().findViewById(R.id.fragment_store_textView_curCity);
	flipper = (ViewFlipper) getView().findViewById(R.id.fragment_store_viewFlipper);
	layout_position = (LinearLayout) getView().findViewById(R.id.fragment_store_layout_position);
	layout_map = (LinearLayout) getView().findViewById(R.id.fragment_store_layout_map);
	editText_keywords = (EditText) getView().findViewById(R.id.fragment_store_editText_keywords);
	gridView = (GridView) getView().findViewById(R.id.fragment_store_gridView);

	gridViewAdapter = new Fragment_Store_GridViewAdapter(getActivity(), eDaoClientConfig.store_class, list_image,
			gridView);
	gridView.setAdapter(gridViewAdapter);
	gridView.setOnItemClickListener(this);
	layout_map.setOnClickListener(this);

	textView_curCity.setText(application.getCurCity());
}
 
Example 32
Project: AISEntry   File: FileReader.java   View source code 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.file_reader);
	
	mMsgHandler = new AISHandler();
	
	mViewFlipper = (ViewFlipper) findViewById(R.id.viewflipper_reader);
	mGestureDetector = new GestureDetector(this, new PageOnGestureListener());
	
	initButtonGroup();
	
	try {
		mFilePath = this.getIntent().getStringExtra(SelectFileActivity.EXTRA_FILEPATH);
		refreshGUI(defaultCode);
	} catch (Exception e) {
	}
}
 
Example 33
Project: QuizUpWinner   File: MatchActivity.java   View source code 6 votes vote down vote up
private void addGlobalLayoutListener()
{
  final ViewFlipper localViewFlipper = (ViewFlipper)findViewById(2131296439);
  localViewFlipper.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
  {
    public void onGlobalLayout()
    {
      if (Build.VERSION.SDK_INT < 16)
        localViewFlipper.getViewTreeObserver().removeGlobalOnLayoutListener(this);
      else
        localViewFlipper.getViewTreeObserver().removeOnGlobalLayoutListener(this);
      int i = localViewFlipper.getMeasuredWidth();
      int j = localViewFlipper.getMeasuredHeight();
      MatchActivity.this.setBitmapSize(i, j);
      if (Build.VERSION.SDK_INT >= 16)
      {
        localViewFlipper.getViewTreeObserver().removeOnGlobalLayoutListener(this);
        return;
      }
      localViewFlipper.getViewTreeObserver().removeGlobalOnLayoutListener(this);
    }
  });
}
 
Example 34
Project: SimplyWeather   File: Main.java   View source code 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    viewFlipper   = (ViewFlipper)findViewById(R.id.flipper);
    slideLeftIn   = AnimationUtils.loadAnimation(this, R.anim.slide_left_in);
    slideLeftOut  = AnimationUtils.loadAnimation(this, R.anim.slide_left_out);
    slideRightIn  = AnimationUtils.loadAnimation(this, R.anim.slide_right_in);
    slideRightOut = AnimationUtils.loadAnimation(this, R.anim.slide_right_out);
    
    gestureDetector = new GestureDetector(new MyGestureDetector());
    new View.OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            return gestureDetector.onTouchEvent(event);
        }
    };
}
 
Example 35
Project: periodical   File: MainActivity.java   View source code 6 votes vote down vote up
/**
 * Handler for "previous month" button in main view
 */
@SuppressWarnings({"UnusedParameters", "SameParameterValue"})
public void goPrev(View v) {
    // Update calendar
    monthCurrent--;
    if (monthCurrent < 1) {
        monthCurrent = 12;
        yearCurrent--;
    }

    if (viewCurrent == R.id.calendar) {
        viewCurrent = R.id.calendar_2;
    } else {
        viewCurrent = R.id.calendar;
    }

    calendarUpdate();

    // Show slide animation from left to right
    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.mainwidget);
    flipper.setInAnimation(AnimationHelper.inFromLeftAnimation());
    flipper.setOutAnimation(AnimationHelper.outToRightAnimation());
    flipper.showNext();
}
 
Example 36
Project: periodical   File: MainActivity.java   View source code 6 votes vote down vote up
/**
 * Handler for "next month" button in main view
 */
@SuppressWarnings({"UnusedParameters", "SameParameterValue"})
public void goNext(View v) {
    // Update calendar
    monthCurrent++;
    if (monthCurrent > 12) {
        monthCurrent = 1;
        yearCurrent++;
    }

    if (viewCurrent == R.id.calendar) {
        viewCurrent = R.id.calendar_2;
    } else {
        viewCurrent = R.id.calendar;
    }

    calendarUpdate();

    // Show slide animation from right to left
    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.mainwidget);
    flipper.setInAnimation(AnimationHelper.inFromRightAnimation());
    flipper.setOutAnimation(AnimationHelper.outToLeftAnimation());
    flipper.showPrevious();
}
 
Example 37
Project: DiaryAndroid   File: SetBackgroundActivity.java   View source code 6 votes vote down vote up
private void init() {
	//设置窗口无标题
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	//得到布局
	setContentView(R.layout.background);
	//实例化手势对象,用以实现手势滑动
	detector = new GestureDetector(this);
	//通过findViewById方法得到Flipper控件
	flipper = (ViewFlipper) this.findViewById(R.id.flipper);
	//在flipper中添加四幅图片
	flipper.addView(getImageView(R.drawable.diary_view_bg));
	flipper.addView(getImageView(R.drawable.spring));
	flipper.addView(getImageView(R.drawable.summer));
	flipper.addView(getImageView(R.drawable.autumn));
	flipper.addView(getImageView(R.drawable.winter));
	//得到设置按钮
	setBackground = (Button) this.findViewById(R.id.backround_set);
	//得到取消按钮
	cancel = (Button) this.findViewById(R.id.backround_cancel);
	//设置按钮监听器
	setBackground.setOnClickListener(new SetBackgroundListener());
	//取消按钮监听器
	cancel.setOnClickListener(new CancelListener());
}
 
Example 38
Project: gdk-charades-sample-master   File: BaseGameActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_gameplay);
    setGesturesEnabled(true);

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    mGestureDetector = new GestureDetector(this).setBaseListener(mBaseListener);
    mPhraseFlipper = (ViewFlipper) findViewById(R.id.phrase_flipper);
    mGameState = (TextView) findViewById(R.id.game_state);
    mTugRightAnimation = AnimationUtils.loadAnimation(this, R.anim.tug_right);

    mModel = createCharadesModel();
    updateDisplay();
}
 
Example 39
Project: gdk-charades-sample   File: BaseGameActivity.java   View source code 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_gameplay);
    setGesturesEnabled(true);

    mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
    mGestureDetector = new GestureDetector(this).setBaseListener(mBaseListener);
    mPhraseFlipper = (ViewFlipper) findViewById(R.id.phrase_flipper);
    mGameState = (TextView) findViewById(R.id.game_state);
    mTugRightAnimation = AnimationUtils.loadAnimation(this, R.anim.tug_right);

    mModel = createCharadesModel();
    updateDisplay();
}
 
Example 40
Project: wear-notify-for-reddit   File: MainActivity.java   View source code 6 votes vote down vote up
@Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    ViewFlipper flipper = (ViewFlipper) findViewById(R.id.main_flipper_benefits);
    flipper.startFlipping();

    registerReceiver(mForceFinishMainActivity,
            new IntentFilter(getString(R.string.force_finish_main_activity)));
    mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
            .addApi(Wearable.API)
            .build();

    mGoogleApiClient.connect();
}