android.support.v7.widget.AppCompatButton Java Examples

The following examples show how to use android.support.v7.widget.AppCompatButton. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoginFragment.java    From ESeal with Apache License 2.0 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_login, container, false);

    loginName = (AppCompatEditText) view.findViewById(R.id.login_name);
    loginPassword = (AppCompatEditText) view.findViewById(R.id.login_password);

    AppCompatButton signInButton = (AppCompatButton) view.findViewById(R.id.sign_in_button);
    signInButton.setOnClickListener(__ -> {
        if (isInputDataValid()) {
            String name = loginName.getText().toString();
            String password = loginPassword.getText().toString();
            mPresenter.saveUser(name, password);
            mPresenter.attemptLogin(name, password, false);
        } else {
            showInputDataError();
        }
    });
    return view;
}
 
Example #2
Source File: FireSignup.java    From Learning-Resources with MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.lo_fire_auth_signup);

    mCrdntrlyot = (CoordinatorLayout) findViewById(R.id.cordntrlyot_fireauth_signup);
    mTxtinptlyotEmail = (TextInputLayout) findViewById(R.id.txtinputlyot_fireauth_signup_email);
    mTxtinptlyotPaswrd = (TextInputLayout) findViewById(R.id.txtinputlyot_fireauth_signup_password);
    mTxtinptEtEmail = (TextInputEditText) findViewById(R.id.txtinptet_fireauth_signup_email);
    mTxtinptEtPaswrd = (TextInputEditText) findViewById(R.id.txtinptet_fireauth_signup_password);
    mAppcmptbtnSignup = (AppCompatButton) findViewById(R.id.appcmptbtn_fireauth_signup);
    mTvFrgtPaswrd = (TextView) findViewById(R.id.tv_fireauth_signup_frgtpaswrd);
    mTvSigninMe = (TextView) findViewById(R.id.tv_fireauth_signup_signinme);
    mPrgrsbrMain = (ProgressBar) findViewById(R.id.prgrsbr_fireauth_signup);

    mFireAuth = FirebaseAuth.getInstance();
    mFireDB = FirebaseDatabase.getInstance();

    mAppcmptbtnSignup.setOnClickListener(this);
    mTvFrgtPaswrd.setOnClickListener(this);
    mTvSigninMe.setOnClickListener(this);
}
 
Example #3
Source File: MultiStateToggleButton.java    From multistatetogglebutton with MIT License 6 votes vote down vote up
public void setButtonState(View button, boolean selected) {
    if (button == null) {
        return;
    }
    button.setSelected(selected);
    button.setBackgroundResource(selected ? R.drawable.button_pressed : R.drawable.button_not_pressed);
    if (colorPressed != 0 || colorNotPressed != 0) {
        button.setBackgroundColor(selected ? colorPressed : colorNotPressed);
    } else if (colorPressedBackground != 0 || colorNotPressedBackground != 0) {
      button.setBackgroundColor(selected ? colorPressedBackground : colorNotPressedBackground);
    }
    if (button instanceof Button) {
        int style = selected ? R.style.WhiteBoldText : R.style.PrimaryNormalText;
        ((AppCompatButton) button).setTextAppearance(this.getContext(), style);
        if (colorPressed != 0 || colorNotPressed != 0) {
            ((AppCompatButton) button).setTextColor(!selected ? colorPressed : colorNotPressed);
        } 
        if (colorPressedText != 0 || colorNotPressedText != 0) {
          ((AppCompatButton) button).setTextColor(selected ? colorPressedText : colorNotPressedText);
        }
        if (pressedBackgroundResource != 0 || notPressedBackgroundResource != 0) {
          button.setBackgroundResource(selected ? pressedBackgroundResource : notPressedBackgroundResource);
        }
    }
}
 
Example #4
Source File: FireResetPassword.java    From Learning-Resources with MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.lo_fire_auth_resetpassword);

    mCrdntrlyot = (CoordinatorLayout) findViewById(R.id.cordntrlyot_fireauth_resetpaswrd);
    mTxtinptlyotEmail = (TextInputLayout) findViewById(R.id.txtinputlyot_fireauth_resetpaswrd_email);
    mTxtinptEtEmail = (TextInputEditText) findViewById(R.id.txtinptet_fireauth_resetpaswrd_email);
    mAppcmptbtnSignup = (AppCompatButton) findViewById(R.id.appcmptbtn_fireauth_resetpaswrd);
    mPrgrsbrMain = (ProgressBar) findViewById(R.id.prgrsbr_fireauth_resetpaswrd);

    mFireAuth = FirebaseAuth.getInstance();

    mAppcmptbtnSignup.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

            // Check all field Validation and call API
            checkVldtnCallApi();
        }
    });

}
 
Example #5
Source File: MainActivity.java    From appauth-android-codelab with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mMainApplication = (MainApplication) getApplication();
  mAuthorize = (AppCompatButton) findViewById(R.id.authorize);
  mMakeApiCall = (AppCompatButton) findViewById(R.id.makeApiCall);
  mSignOut = (AppCompatButton) findViewById(R.id.signOut);
  mGivenName = (AppCompatTextView) findViewById(R.id.givenName);
  mFamilyName = (AppCompatTextView) findViewById(R.id.familyName);
  mFullName = (AppCompatTextView) findViewById(R.id.fullName);
  mProfileView = (ImageView) findViewById(R.id.profileImage);

  enablePostAuthorizationFlows();

  // wire click listeners
  mAuthorize.setOnClickListener(new AuthorizeListener());
}
 
Example #6
Source File: MainActivity.java    From appauth-android-codelab with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mMainApplication = (MainApplication) getApplication();
  mAuthorize = (AppCompatButton) findViewById(R.id.authorize);
  mMakeApiCall = (AppCompatButton) findViewById(R.id.makeApiCall);
  mSignOut = (AppCompatButton) findViewById(R.id.signOut);
  mGivenName = (AppCompatTextView) findViewById(R.id.givenName);
  mFamilyName = (AppCompatTextView) findViewById(R.id.familyName);
  mFullName = (AppCompatTextView) findViewById(R.id.fullName);
  mProfileView = (ImageView) findViewById(R.id.profileImage);

  enablePostAuthorizationFlows();

  // wire click listeners
  mAuthorize.setOnClickListener(new AuthorizeListener());
}
 
Example #7
Source File: MainActivity.java    From appauth-android-codelab with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mMainApplication = (MainApplication) getApplication();
  mAuthorize = (AppCompatButton) findViewById(R.id.authorize);
  mMakeApiCall = (AppCompatButton) findViewById(R.id.makeApiCall);
  mSignOut = (AppCompatButton) findViewById(R.id.signOut);
  mGivenName = (AppCompatTextView) findViewById(R.id.givenName);
  mFamilyName = (AppCompatTextView) findViewById(R.id.familyName);
  mFullName = (AppCompatTextView) findViewById(R.id.fullName);
  mProfileView = (ImageView) findViewById(R.id.profileImage);

  enablePostAuthorizationFlows();

  // wire click listeners
  mAuthorize.setOnClickListener(new AuthorizeListener(this));

  // Retrieve app restrictions and take appropriate action
  getAppRestrictions();
}
 
Example #8
Source File: MainActivity.java    From AutoTrackAppClick6 with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("all")
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case R.id.menu_more:
            ViewGroup rootView = findViewById(R.id.rootView);
            AppCompatButton button = new AppCompatButton(this);
            button.setText("动态创建的 Button");
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {

                }
            });
            rootView.addView(button);
            break;
    }
    return super.onOptionsItemSelected(item);
}
 
Example #9
Source File: MainActivity.java    From Skeleton with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Find view
    AppCompatButton sampleGradientXmlBtn = findViewById(R.id.sampleGradientXmlBtn);
    AppCompatButton sampleFadeXml1Btn = findViewById(R.id.sampleFadeXml1Btn);
    AppCompatButton sampleFadeXml2Btn = findViewById(R.id.sampleFadeXml2Btn);
    AppCompatButton sampleShapeXmlBtn = findViewById(R.id.sampleShapeXmlBtn);
    AppCompatButton sampleAutoItemsCountXmlBtn = findViewById(R.id.sampleAutoItemsCountXmlBtn);
    AppCompatButton sampleGradientJavaBtn = findViewById(R.id.sampleGradientJavaBtn);
    AppCompatButton sampleAddViewsByJavaBtn = findViewById(R.id.sampleAddViewsByJavaBtn);

    // Set on click listener for buttons
    sampleGradientXmlBtn.setOnClickListener(this);
    sampleFadeXml1Btn.setOnClickListener(this);
    sampleFadeXml2Btn.setOnClickListener(this);
    sampleShapeXmlBtn.setOnClickListener(this);
    sampleAutoItemsCountXmlBtn.setOnClickListener(this);
    sampleGradientJavaBtn.setOnClickListener(this);
    sampleAddViewsByJavaBtn.setOnClickListener(this);

}
 
Example #10
Source File: MainActivity.java    From ZLoading with MIT License 6 votes vote down vote up
private void createAllButton(LinearLayout containerLinearLayout)
{
    AppCompatButton button = new AppCompatButton(this);
    int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics());
    button.setPadding(padding, padding, padding, padding);
    containerLinearLayout.addView(button, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    button.setText("Show Time");
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v)
        {
            Intent intent = new Intent(MainActivity.this, ShowTimeAllActivity.class);
            startActivity(intent);
        }
    });
}
 
Example #11
Source File: MainActivity.java    From ECardFlow with MIT License 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btnCard = (AppCompatButton) findViewById(R.id.btn_card);
    btnLayout = (AppCompatButton) findViewById(R.id.btn_layout);
    btnLayoutBlur = (AppCompatButton) findViewById(R.id.btn_layout_blur);
    btnLayoutMove = (AppCompatButton) findViewById(R.id.btn_layout_move);
    btnLayoutScale = (AppCompatButton) findViewById(R.id.btn_layout_scale);
    btnLayoutCrossMove = (AppCompatButton) findViewById(R.id.btn_layout_cross);

    btnCard.setOnClickListener(this);
    btnLayout.setOnClickListener(this);
    btnLayoutBlur.setOnClickListener(this);
    btnLayoutMove.setOnClickListener(this);
    btnLayoutScale.setOnClickListener(this);
    btnLayoutCrossMove.setOnClickListener(this);
}
 
Example #12
Source File: ThemeDialog.java    From PicKing with Apache License 2.0 6 votes vote down vote up
public ThemeDialog(@NonNull Context context, BaseActivity activity) {
    super(context, R.style.Theme_AppCompat_Dialog_MinWidth);
    setOwnerActivity((Activity) context);
    setContentView(R.layout.dialog_theme);

    ButterKnife.bind(this);

    this.activity = activity;

    for (AppCompatButton button : buttons)
        button.setOnClickListener(this);
}
 
Example #13
Source File: Luhn.java    From Luhn with MIT License 6 votes vote down vote up
private void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) {
    hideKeyboard();
    AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header);
    AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc);
    AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img);
    if (error) {
        llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE);
        ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close");
    } else {
        llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE);
        ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok");
    }

    infoHeader.setText(header);
    infoDesc.setText(desc);
    if (drawable != null)
        infoImg.setImageDrawable(drawable);
    bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
 
Example #14
Source File: BaseActivity.java    From africastalking-android with MIT License 6 votes vote down vote up
protected void showInfo(String header, String desc, @Nullable Drawable drawable, boolean error) {
    hideKeyboard();
    AppCompatTextView infoHeader = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_header);
    AppCompatTextView infoDesc = (AppCompatTextView) llBottomSheet.findViewById(R.id.info_desc);
    AppCompatImageView infoImg = (AppCompatImageView) llBottomSheet.findViewById(R.id.info_img);
    if (error) {
        llBottomSheet.findViewById(R.id.info_img).setVisibility(View.GONE);
        ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Close");
    } else {
        llBottomSheet.findViewById(R.id.info_img).setVisibility(View.VISIBLE);
        ((AppCompatButton) findViewById(R.id.ok_dimiss)).setText("Ok");
    }

    infoHeader.setText(header);
    infoDesc.setText(desc);
    if (drawable != null)
        infoImg.setImageDrawable(drawable);
    bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
 
Example #15
Source File: MainActivity.java    From ThreadDebugger with Apache License 2.0 5 votes vote down vote up
private void assignViews() {
    mRandomThreadWorkBtn = (AppCompatButton) findViewById(R.id.random_thread_work_btn);
    mAddTaskToIoBtn = (AppCompatButton) findViewById(R.id.add_task_to_io_btn);
    mAddTaskToComputationBtn = (AppCompatButton) findViewById(R.id.add_task_to_computation_btn);
    mAddTaskToNetworkBtn = (AppCompatButton) findViewById(R.id.add_task_to_network_btn);
    mAddTaskToTest1Btn = (AppCompatButton) findViewById(R.id.add_task_to_test1_btn);
    mAddTaskToTest2Btn = (AppCompatButton) findViewById(R.id.add_task_to_test2_btn);
    mAddTaskToTest3Btn = (AppCompatButton) findViewById(R.id.add_task_to_test3_btn);
    mAddTaskToTest4Btn = (AppCompatButton) findViewById(R.id.add_task_to_test4_btn);
}
 
Example #16
Source File: LoginActivity.java    From Saude-no-Mapa with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    ButterKnife.bind(this);

    mPresenter = new LoginPresenterImpl(this, this);

    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP && loginFacebookButton instanceof AppCompatButton) {
        ((AppCompatButton) loginFacebookButton).setSupportBackgroundTintList(getResources().getColorStateList(R.color.facebook_blue));
    } else {
        ViewCompat.setBackgroundTintList(loginFacebookButton, getResources().getColorStateList(R.color.facebook_blue));
    }
}
 
Example #17
Source File: DefaultTipsHelper.java    From GankGirl with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void showError(boolean firstPage, String errorMessage, View.OnClickListener onClickListener) {
    hideLoading();
    if (firstPage) {
        View tipsView = TipsUtils.showTips(mView, TipsType.LOADING_FAILED);
        AppCompatButton retryBtn= (AppCompatButton)tipsView.findViewById(R.id.retry_btn);
        retryBtn.setOnClickListener(onClickListener);
        retryBtn.setSupportBackgroundTintList(mContext.getResources().getColorStateList(R.color.accent));
        retryBtn.setSupportBackgroundTintMode(PorterDuff.Mode.SRC_IN);
        if (!TextUtils.isEmpty(errorMessage)) {
            ((TextView) tipsView.findViewById(R.id.description)).setText(errorMessage);
        }
    }
}
 
Example #18
Source File: MainActivity.java    From ViewPagerLayoutManager with Apache License 2.0 5 votes vote down vote up
private void startActivity(Class clz, View view) {
    Intent intent = new Intent(this, clz);
    if (view instanceof AppCompatButton) {
        intent.putExtra(INTENT_TITLE, ((AppCompatButton) view).getText());
    }
    startActivity(intent);
}
 
Example #19
Source File: MainActivity.java    From material-intro-screen with MIT License 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    button = (AppCompatButton) findViewById(R.id.btn_launch_activity);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(MainActivity.this, IntroActivity.class);
            startActivity(intent);
        }
    });
}
 
Example #20
Source File: PersonDetail.java    From kute with Apache License 2.0 5 votes vote down vote up
private void setupRoutesRow(){
    load_routes=new LoadPersonRoutesAsyncTask(this);
    load_routes.execute(p.id);
    view_all_routes=(AppCompatButton)findViewById(R.id.viewAllRoutes);
    view_all_routes.setOnClickListener(this);
    view_all_routes.setEnabled(false);
    PlaceHolderFragment loading = new PlaceHolderFragment();
    Bundle args = new Bundle();
    args.putString("Label", "Loading...");
    loading.setArguments(args);
    getSupportFragmentManager().beginTransaction().replace(R.id.routeFramePersonDetail, loading).commit();
}
 
Example #21
Source File: FriendTab.java    From kute with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    Log.d(TAG,"onViewCreated");
    v=inflater.inflate(R.layout.friend_tab_bottomnavigation,container,false);
    viewall_currentfriends=(AppCompatButton)v.findViewById(R.id.viewallCurrentfriends);
    viewall_currentfriends.setEnabled(false); //The button wont be active until and unless we get the entire friendlist
    viewall_currentfriends.setOnClickListener(this);
    return v;
}
 
Example #22
Source File: AddAccountActivity.java    From Puff-Android with MIT License 5 votes vote down vote up
private void wireViews() {
    name = (EditText) findViewById(R.id.id_name);
    account = (EditText) findViewById(R.id.account);
    password = (EditText) findViewById(R.id.password);
    addtional = (EditText) findViewById(R.id.additional);
    imageView = (AppCompatImageView) findViewById(R.id.account_image);
    website = (EditText) findViewById(R.id.website);
    generateButton = (AppCompatButton) findViewById(R.id.generate_button);
}
 
Example #23
Source File: LogOnActivity.java    From nono-android with GNU General Public License v3.0 5 votes vote down vote up
void getDefinition()
{
    mLogOnButton=(AppCompatImageView)this.findViewById(R.id.account_sign_in_button);
    mRegisterButton = (AppCompatButton)findViewById(R.id.account_register_button);
    passwordEditText=((EditText)this.findViewById(R.id.password));
    tv_find_password = ((AppCompatTextView) this.findViewById(R.id.tv_find_password));
    tv_quick_log_on = ((AppCompatTextView) this.findViewById(R.id.tv_quick_log_on));

}
 
Example #24
Source File: StatsActivity.java    From NightWatch with GNU General Public License v3.0 5 votes vote down vote up
private void assignButtonNames() {
    buttonTD = (AppCompatButton) findViewById(R.id.button_stats_today);
    buttonYTD = (AppCompatButton) findViewById(R.id.button_stats_yesterday);
    button7d = (AppCompatButton) findViewById(R.id.button_stats_7d);
    button30d = (AppCompatButton) findViewById(R.id.button_stats_30d);
    button90d = (AppCompatButton) findViewById(R.id.button_stats_90d);
}
 
Example #25
Source File: StatsActivity.java    From NightWatch with GNU General Public License v3.0 5 votes vote down vote up
private void assignButtonNames() {
    buttonTD = (AppCompatButton) findViewById(R.id.button_stats_today);
    buttonYTD = (AppCompatButton) findViewById(R.id.button_stats_yesterday);
    button7d = (AppCompatButton) findViewById(R.id.button_stats_7d);
    button30d = (AppCompatButton) findViewById(R.id.button_stats_30d);
    button90d = (AppCompatButton) findViewById(R.id.button_stats_90d);
}
 
Example #26
Source File: LyricsViewFragment.java    From QuickLyric with GNU General Public License v3.0 5 votes vote down vote up
@RequiresApi(21)
public void showBrokenScrobblingWarning() {
    if (controllerCallback == null)
        controllerCallback = new MediaControllerCallback(null);
    if (NotificationListenerService.isListeningAuthorized(getActivity()))
        MediaControllerCallback.registerFallbackControllerCallback(getActivity(), controllerCallback);

    String[] manufacturers = new String[]{"XIAOMI", "HUAWEI", "HONOR", "LETV"};
    final boolean canFix = Arrays.asList(manufacturers).contains(Build.BRAND.toUpperCase());
    if (canFix && !PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("nls_warning_removed", false)) {
        final ViewGroup nlsWarning = (ViewGroup) LayoutInflater.from(getActivity()).inflate(R.layout.nls_warning, (ViewGroup) getView(), false);
        AppCompatButton button = nlsWarning.findViewById(R.id.fix_it);
        button.setText(R.string.fix_it);
        button.setOnClickListener(view -> {
            if (!WhiteListUtil.openBootSpecialMenu(getActivity())) {
                MainActivity.startFeedbackActivity(getActivity(), true);
            }
            warningShown = false;
            removePrompt(nlsWarning, false);
        });
        AppCompatImageButton closeButton = nlsWarning.findViewById(R.id.ic_nls_warning_close);
        closeButton.setOnClickListener(view -> {
            removePrompt(nlsWarning, true);
            PreferenceManager.getDefaultSharedPreferences(getActivity()).edit().putBoolean("nls_warning_removed", true).apply();
        });
        ((ViewGroup) getView()).addView(nlsWarning);
        warningShown = true;
        nlsWarning.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if (mRefreshLayout.getProgressViewEndOffset() == 0)
                    mRefreshLayout.setProgressViewOffset(true, 0, nlsWarning.getMeasuredHeight());
                nlsWarning.getViewTreeObserver().removeGlobalOnLayoutListener(this);
            }
        });
    }
}
 
Example #27
Source File: MainActivity.java    From AutoTrackAppClick6 with Apache License 2.0 5 votes vote down vote up
private void initTabHostButton() {
    AppCompatButton button = findViewById(R.id.tabHostButton);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, TabHostTestActivity.class);
            startActivity(intent);
        }
    });
}
 
Example #28
Source File: ColorEditDialog.java    From AndroidPhotoshopColorPicker with Artistic License 2.0 5 votes vote down vote up
private void init(Context context){
    getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(LayoutInflater.from(context).inflate(R.layout.dialod_edit_color_root, null));

    colorEditorRoot=(RelativeLayout)findViewById(R.id.colorEditorRoot);

    doneButton=(AppCompatButton)findViewById(R.id.doneEditing);
    cancelButton=(AppCompatButton)findViewById(R.id.cancelEditing);
    name1=(TextView)findViewById(R.id.name1);
    name2=(TextView)findViewById(R.id.name2);
    name3=(TextView)findViewById(R.id.name3);
    suffix1=(TextView)findViewById(R.id.suffix1);
    suffix2=(TextView)findViewById(R.id.suffix2);
    suffix3=(TextView)findViewById(R.id.suffix3);
    val1=(EditText)findViewById(R.id.val1);
    val2=(EditText)findViewById(R.id.val2);
    val3=(EditText)findViewById(R.id.val3);

    setModeAndValues(MODE_HSV, "", "", "",255);

    cancelButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            dismiss();
        }
    });
}
 
Example #29
Source File: LEDActivity.java    From styT with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_led);

    mContentLed = (TextInputEditText) findViewById(R.id.content_led);
    Button mFontcolorBtnLed = (Button) findViewById(R.id.fontcolor_btn_led);
    Button mBgcolorBtnLed = (Button) findViewById(R.id.bgcolor_btn_led);
    mPreviewLed = (TextView) findViewById(R.id.preview_led);

    ImageView mReverseColorLed = (ImageView) findViewById(R.id.reverseColor_led);

    mShowstyleRadiogroupLed = (RadioGroup) findViewById(R.id.showstyle_radiogroup_led);

    AppCompatRadioButton mSingleRadiobtnLed = (AppCompatRadioButton) findViewById(R.id.single_radiobtn_led);
    AppCompatRadioButton mSingleTossBtnLed = (AppCompatRadioButton) findViewById(R.id.single_toss_radiobtn_led);

    mRollspeedSeekbarLed = (AppCompatSeekBar) findViewById(R.id.rollspeed_seekbar_led);
    mAdaptiveRadiobtnLed = (AppCompatRadioButton) findViewById(R.id.adaptive_radiobtn_led);
    mLinesTextView = (TextView) findViewById(R.id.tv_lines_led);
    mlinesSeekbar = (AppCompatSeekBar) findViewById(R.id.lines_seekbar_led);
    AppCompatRadioButton mMagicRadiobtnLed = (AppCompatRadioButton) findViewById(R.id.magic_radiobtn_led);
    mCompatSpinner = (AppCompatSpinner) findViewById(R.id.spinner_magicstyle_led);
    Button mStartBtnLed = (AppCompatButton) findViewById(R.id.start_btn_led);

    if (mFontcolorBtnLed != null) {
        mFontcolorBtnLed.setOnClickListener(this);
    }
    if (mStartBtnLed != null) {
        mStartBtnLed.setOnClickListener(this);
    }
    if (mBgcolorBtnLed != null) {
        mBgcolorBtnLed.setOnClickListener(this);
    }

    initViewEvent();
}
 
Example #30
Source File: MainActivity.java    From AutoTrackAppClick6 with Apache License 2.0 5 votes vote down vote up
private void initExpandableListViewTest() {
    AppCompatButton button = findViewById(R.id.expandableListViewTest);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(MainActivity.this, ExpandableListViewTestActivity.class);
            startActivity(intent);
        }
    });
}