微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.support.v7.widget.AppCompatButton的实例源码

项目:africastalking-android    文件BaseActivity.java   
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);
}
项目:Phoenix-for-VK    文件AbsstepHolder.java   
public AbsstepHolder(ViewGroup parent,int internalLayoutRes,int stepIndex) {
    super(createVerticalMainHolderView(parent));

    this.index = stepIndex;
    this.counterRoot = itemView.findViewById(R.id.counter_root);
    this.counterText = (TextView) itemView.findViewById(R.id.counter);
    this.titleText = (TextView) itemView.findViewById(R.id.title);
    this.line = itemView.findViewById(R.id.step_line);
    this.buttonNext = (AppCompatButton) itemView.findViewById(R.id.buttonNext);
    this.buttonCancel = (Button) itemView.findViewById(R.id.buttonCancel);
    this.content = (ViewGroup) itemView.findViewById(R.id.content);
    this.contentRoot = itemView.findViewById(R.id.content_root);

    this.mContentView = LayoutInflater.from(itemView.getContext()).inflate(internalLayoutRes,parent,false);
    this.content.addView(mContentView);

    initInternalView(mContentView);
}
项目:civify-app    文件IssueDetailsFragment.java   
private void setupConfirmButton() {
    AppCompatButton button = (AppCompatButton) mViewDetails.findViewById(R.id.confirmButton);
    String issueUserToken = mIssue.getUserAuthToken();
    String userToken = UserAdapter.getCurrentUser().getUserAuthToken();

    if (issueUserToken.equals(userToken)) {
        button.setAlpha(disABLED_ALPHA);
        button.setonClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Snackbar.make(getView(),R.string.cant_confirm_own_issue,Snackbar.LENGTH_SHORT)
                        .show();
            }
        });
    } else {
        if (mIssue.getConfirmedByAuthUser()) {
            changeButtonStyle(button,IssueButton.UNCONFIRM);
        }
        IssueButtonListener buttonListener =
                new IssueButtonListener(this,mViewDetails,mIssue,IssueButton.CONFIRM,IssueButton.UNCONFIRM);

        button.setonClickListener(buttonListener);
    }
}
项目:civify-app    文件IssueDetailsFragment.java   
private void setupReportButton() {
    AppCompatButton button = (AppCompatButton) mViewDetails.findViewById(R.id.reportButton);
    String issueUserToken = mIssue.getUserAuthToken();
    String userToken = UserAdapter.getCurrentUser().getUserAuthToken();

    if (issueUserToken.equals(userToken)) {
        button.setAlpha(disABLED_ALPHA);
        button.setonClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Snackbar.make(getView(),R.string.cant_report_own_issue,Snackbar.LENGTH_SHORT)
                        .show();
            }
        });
    } else {
        if (mIssue.getReportedByAuthUser()) {
            changeButtonStyle(button,IssueButton.UNREPORT);
        }
        IssueButtonListener buttonListener =
                new IssueButtonListener(this,IssueButton.REPORT,IssueButton.UNREPORT);
        button.setonClickListener(buttonListener);
    }
}
项目:civify-app    文件LoginActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    mBlogin = (AppCompatButton) findViewById(R.id.bsignin);
    mBlogin.setonClickListener(mListen);
    mUser = (EditText) findViewById(R.id.login_email_input);
    mPassw = (EditText) findViewById(R.id.login_password_input);
    mPassforgot = (TextView) findViewById(R.id.login_forgot);
    mIconFirstCredential = (ImageView) findViewById(R.id.email_errors_icon);
    mMessageFirstCredential = (TextView) findViewById(R.id.email_errors_text);
    mIconPassword = (ImageView) findViewById(R.id.password_errors_icon);
    mMessagePassword = (TextView) findViewById(R.id.password_errors_text);
    mPassforgot.setonClickListener(mListen);
    mLoginAdapter = AdapterFactory.getInstance().getLoginAdapter(this);

}
项目:iSPY    文件Registeractivity.java   
/**
 * This method is to initialize views
 */
private void initViews() {
    nestedScrollView = (nestedScrollView) findViewById(R.id.nestedScrollView);

    textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayoutName);
    textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail);
    textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword);
    textInputLayoutConfirmPassword = (TextInputLayout) findViewById(R.id.textInputLayoutConfirmPassword);

    textInputEditTextName = (TextInputEditText) findViewById(R.id.textInputEditTextName);
    textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail);
    textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword);
    textInputEditTextConfirmPassword = (TextInputEditText) findViewById(R.id.textInputEditTextConfirmPassword);

    appCompatButtonRegister = (AppCompatButton) findViewById(R.id.appCompatButtonRegister);

    appCompatTextViewLoginLink = (AppCompatTextView) findViewById(R.id.appCompatTextViewLoginLink);

}
项目:Luhn    文件Luhn.java   
private void showInfo(String header,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);
}
项目:ECardFlow    文件MainActivity.java   
@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);
}
项目:fussroll    文件DeleteActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_delete);

    Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar);
    setSupportActionBar(toolbar);

    editText = (EditText) findViewById(R.id.editText);
    textInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout);

    if(getSupportActionBar() != null) {
        getSupportActionBar().setdisplayHomeAsUpEnabled(true);
        getSupportActionBar().setdisplayShowHomeEnabled(true);
    }

    AppCompatButton appCompatButton = (AppCompatButton) findViewById(R.id.button);
    appCompatButton.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            delete();
        }
    });
}
项目:fussroll    文件Registeractivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);

    editText = (EditText) findViewById(R.id.editText);
    spinner = (Spinner) findViewById(R.id.spinner);
    textInputLayout = (TextInputLayout) findViewById(R.id.textInputLayout);

    ArrayAdapter<CharSequence> arrayAdapter = ArrayAdapter.createFromresource(this,R.array.countries,R.layout.spinner_layout);
    arrayAdapter.setDropDownViewResource(R.layout.spinner_layout);
    spinner.setAdapter(arrayAdapter);

    AppCompatButton appCompatButton = (AppCompatButton) findViewById(R.id.button);
    appCompatButton.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            register();
        }
    });

}
项目:Skeleton    文件MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //find view
    sample1Btn = (AppCompatButton) findViewById(R.id.sample1Btn);
    sample2Btn = (AppCompatButton) findViewById(R.id.sample2Btn);
    sample3Btn = (AppCompatButton) findViewById(R.id.sample3Btn);
    sample4Btn = (AppCompatButton) findViewById(R.id.sample4Btn);
    sample5Btn = (AppCompatButton) findViewById(R.id.sample5Btn);

    //set on click listener for buttons
    sample1Btn.setonClickListener(this);
    sample2Btn.setonClickListener(this);
    sample3Btn.setonClickListener(this);
    sample4Btn.setonClickListener(this);
    sample5Btn.setonClickListener(this);


}
项目:appauth-android-codelab    文件MainActivity.java   
@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();
}
项目:appauth-android-codelab    文件MainActivity.java   
@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());
}
项目:SIstem-INFORMASI-GEOGRAFIS-LOKASI-RESTORAN-DI-KOTA-BANDUNG-SUB-MODUL-ANDROID-BASE-APPLICATION-    文件LoginActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);
    context = LoginActivity.this;

    pDialog = new ProgressDialog(context);
    editTextEmail = (EditText) findViewById(R.id.editTextEmail);
    editTextPassword = (EditText) findViewById(R.id.editTextPassword);
    buttonLogin = (AppCompatButton) findViewById(R.id.buttonLogin);

    buttonLogin.setonClickListener(new View.OnClickListener(){
        @Override
        public void onClick(View v){
            login();
        }
    });
}
项目:UCLayout    文件MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    voiceView = (UcVoiceView) findViewById(R.id.ucVoice);
    start = (AppCompatButton) findViewById(R.id.start);
    start.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if(!visible){
                voiceView.showVoice();
            }else{
                voiceView.hideVoice();
            }

            visible = !visible;
        }
    });
}
项目:ESeal    文件LoginFragment.java   
@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;
}
项目:vertical-stepper-form    文件VerticalStepperFormlayout.java   
protected void setUpStepLayoutAsConfirmationStepLayout(LinearLayout stepLayout) {
    LinearLayout stepLeftLine = (LinearLayout) stepLayout.findViewById(R.id.vertical_line);
    LinearLayout stepLeftLine2 = (LinearLayout) stepLayout.findViewById(R.id.vertical_line_subtitle);
    confirmationButton = (AppCompatButton) stepLayout.findViewById(R.id.next_step);

    stepLeftLine.setVisibility(View.INVISIBLE);
    stepLeftLine2.setVisibility(View.INVISIBLE);

    disableConfirmationButton();

    confirmationButton.setText(R.string.vertical_form_stepper_form_confirm_button);
    confirmationButton.setonClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            prepareSendingAndSend();
        }
    });

    // Some content Could be added to the final step inside stepContent layout
    // RelativeLayout stepContent = (RelativeLayout) stepLayout.findViewById(R.id.step_content);
}
项目:vertical-stepper-form    文件VerticalStepperFormlayout.java   
protected void setButtonColor(AppCompatButton button,int buttonColor,int buttonTextColor,int buttonpressedColor,int buttonpressedTextColor) {
    int[][] states = new int[][]{
            new int[]{android.R.attr.state_pressed},new int[]{android.R.attr.state_focused},new int[]{}
    };
    ColorStateList buttonColours = new ColorStateList(
            states,new int[]{
                    buttonpressedColor,buttonpressedColor,buttonColor
            });
    ColorStateList buttonTextColours = new ColorStateList(
            states,new int[]{
                    buttonpressedTextColor,buttonpressedTextColor,buttonTextColor
            });
    button.setSupportBackgroundTintList(buttonColours);
    button.setTextColor(buttonTextColours);
}
项目:HorseandRidersCompanion    文件MainActivity.java   
@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,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();
}
项目:EliteMvp    文件Sample4Activity.java   
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample_rx);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(getString(R.string.example_rx2));
        getSupportActionBar().setdisplayHomeAsUpEnabled(true);
    }

    // Initialize Presenter
    presenter = new Sample4Presenter();
    // Attach View to it
    presenter.attachView(this);

    // FindViewByIds,ClickListeners
    textView = (TextView) findViewById(R.id.text_sampleRx_list);
    AppCompatButton buttonGenerate = (AppCompatButton) findViewById(R.id.button_sampleRx_generate);
    buttonGenerate.setonClickListener(new View.OnClickListener() {
        @Override public void onClick(View view) {
            // Call Presenter Method
            presenter.createList();
        }
    });
}
项目:EliteMvp    文件Sample3Activity.java   
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample_rx);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(getString(R.string.example_rx1));
        getSupportActionBar().setdisplayHomeAsUpEnabled(true);
    }

    // Initialize Presenter
    presenter = new Sample3Presenter();
    // Attach View to it
    presenter.attachView(this);

    // FindViewByIds,ClickListeners
    textView = (TextView) findViewById(R.id.text_sampleRx_list);
    AppCompatButton buttonGenerate = (AppCompatButton) findViewById(R.id.button_sampleRx_generate);
    buttonGenerate.setonClickListener(new View.OnClickListener() {
        @Override public void onClick(View view) {
            // Call Presenter Method
            presenter.createList();
        }
    });
}
项目:EliteMvp    文件Sample7Activity.java   
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample_rx);
    if (getSupportActionBar() != null) {
        getSupportActionBar().setTitle(getString(R.string.example_null_view_rx1));
        getSupportActionBar().setdisplayHomeAsUpEnabled(true);
    }

    // Initialize Presenter
    presenter = new Sample7Presenter(Sample7Contract.View.class);
    // Attach View to it
    presenter.attachView(this);

    // FindViewByIds,ClickListeners
    textView = (TextView) findViewById(R.id.text_sampleRx_list);
    AppCompatButton buttonGenerate = (AppCompatButton) findViewById(R.id.button_sampleRx_generate);
    buttonGenerate.setonClickListener(new View.OnClickListener() {
        @Override public void onClick(View view) {
            // Call Presenter Method
            presenter.createList();
        }
    });
}
项目:ContentBlocker    文件OnboardingActivity.java   
@Override
public View onCreateView(LayoutInflater inflater,Bundle savedInstanceState) {
    int page = getArguments().getInt(ARG_SECTION_NUMBER);
    View rootView = inflater.inflate(R.layout.fragment_onboarding,false);

    ImageView image = (ImageView) rootView.findViewById(R.id.sectionImage);
    image.setimageResource(getimageForbrowser(page,1));

    TextView titleView = (TextView) rootView.findViewById(R.id.sectionTitle);
    titleView.setText(getTitleForPage(page));

    TextView textView = (TextView) rootView.findViewById(R.id.sectionMessage);
    textView.setText(getTextForPage(page));

    AppCompatButton button = (AppCompatButton) rootView.findViewById(R.id.sectionButton);
    button.setText(getButtonTextForPage(page));
    button.setonClickListener(listener);

    return rootView;
}
项目:vertical-stepper    文件VerticalStepper.java   
@VisibleForTesting
void initSteps(@Nullable SavedState savedState) {
    ContextThemeWrapper contextwrapper = new ContextThemeWrapper(context,continueButtonStyle);
    int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        Step.State initialState = savedState != null ? savedState.stepStates.get(i) : null;
        Step step = new Step(getChildAt(i),new InternalTouchView(context),new AppCompatButton(contextwrapper,null,0),commonStepValues,initialState);
        steps.add(step);
    }

    for (Step s : steps) {
        initTouchView(s);
        initNavButtons(s);
        syncVisibilityWithActiveState(s);
    }
}
项目:vertical-stepper    文件VerticalStepper.java   
@VisibleForTesting
int calculateMaxStepWidth() {
    int width = 0;
    for (int i = 0,innerViewsSize = steps.size(); i < innerViewsSize; i++) {
        Step step = steps.get(i);

        width = Math.max(width,step.calculateStepDecoratorWidth());

        View innerView = step.getInnerView();
        int innerViewHorizontalPadding = step.calculateHorizontalUsedspace(innerView);
        width = Math.max(width,innerView.getMeasuredWidth() + innerViewHorizontalPadding);

        AppCompatButton continueButton = step.getContinueButton();
        int continueHorizontalPadding = step.calculateHorizontalUsedspace(continueButton);
        width = Math.max(width,continueButton.getMeasuredWidth() + continueHorizontalPadding);
    }
    return width;
}
项目:vertical-stepper    文件VerticalStepperTest.java   
MockedStep() {
    innerView = mock(View.class);
    innerLayoutParams = mock(VerticalStepper.LayoutParams.class);
    when(innerView.getLayoutParams()).thenReturn(innerLayoutParams);

    continueButton = mock(AppCompatButton.class);
    continueLayoutParams = mock(VerticalStepper.LayoutParams.class);
    when(continueButton.getLayoutParams()).thenReturn(continueLayoutParams);

    touchView = mock(VerticalStepper.InternalTouchView.class);

    step = mock(Step.class);
    when(step.getInnerView()).thenReturn(innerView);
    when(step.getTouchView()).thenReturn(touchView);
    when(step.getContinueButton()).thenReturn(continueButton);
}
项目:Focus-Android-App    文件Registeractivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(com.hybrid.freeopensourceusers.R.layout.activity_register);
    myApplication = MyApplication.getInstance();
    volleySingleton = VolleySingleton.getInstance();
    requestQueue = volleySingleton.getRequestQueue();
    sharedPrefManager = new SharedPrefManager(this);

    circleImageView = (CircleImageView) findViewById(R.id.userProfile);
    changeProfile = (AppCompatButton) findViewById(R.id.btn_change);
    input_nameRegister = (EditText) findViewById(R.id.input_nameRegister);
    input_emailRegister = (EditText) findViewById(R.id.input_emailRegister);
    input_passwordRegister = (EditText) findViewById(R.id.input_passwordRegister);
    input_retypepasswordRegister = (EditText) findViewById(R.id.input_retypepasswordRegister);

    changeProfile.setonClickListener(this);
    mExecutor = Executors.newSingleThreadExecutor();

    final Uri uri = getIntent().getData();
    if(uri != null)
        mExecutor.submit(new Registeractivity.LoadScaledImageTask(this,uri,circleImageView,calcImageSize()));


}
项目:joy-app    文件PoiDetailCommentWidget.java   
@Override
protected View onCreateView(Activity activity,Object... args) {

    mAdapter = new CommentLlvAdapter();

    View contentView = activity.getLayoutInflater().inflate(R.layout.view_poi_detail_comment,null);

    LinearLayout rootDiv = (LinearLayout) contentView.findViewById(R.id.llRootDiv);
    mscoreWidget = new CommentscoresWidget(getActivity());
    rootDiv.addView(mscoreWidget.getContentView(),0);

    mLinearLv = (LinearListView) contentView.findViewById(R.id.linearLv);
    mAcbSeeAll = (AppCompatButton) contentView.findViewById(R.id.acbSeeAll);
    mAcbSeeAll.setonClickListener(this);

    return contentView;
}
项目:joy-app    文件OrderBookProfileActivity.java   
@Override
protected void initContentView() {

    mSdvPhoto = (FrescoIv) findViewById(R.id.sdvPhoto);
    mTvTitle = (TextView) findViewById(R.id.tvTitle);

    mEtName = (EditText) findViewById(R.id.etName);
    mEtPhone = (EditText) findViewById(R.id.etPhone);
    mEtEmail = (EditText) findViewById(R.id.etEmail);

    mTvPrice = (TextView) findViewById(R.id.tvTotalPrice);
    mAcbNext = (AppCompatButton) findViewById(R.id.acbNext);
    mAcbNext.setonClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            checkProfileThenSubmit();
        }
    });

    mSdvPhoto.setimageURI(mPhotoUrl);
    mTvTitle.setText(mTitle);
    mTvPrice.setText(JTextSpanUtil.getFormatUnitStr(mTotalPrice));
}
项目:android-gradle-java-app-template    文件PlaceholderFragment.java   
@Override
public View onCreateView(final LayoutInflater inflater,final ViewGroup container,final Bundle savedInstanceState) {
    super.onCreateView(inflater,savedInstanceState);

    final View rootView = inflater.inflate(R.layout.fragment_main,false);

    this.mButtonStartInterstitial = (AppCompatButton) rootView.findViewById(R.id.buttonStartInterstitial);
    this.mButtonStartInterstitial.setonClickListener(this.mOnClickListener);

    this.mAdView = (AdView) rootView.findViewById(R.id.adView);
    this.mAdView.setAdListener(this.mAdListener);
    this.mAdView.loadAd(new AdRequest.Builder().build());

    this.mInterstitialAd = new InterstitialAd(this.getActivity());
    this.mInterstitialAd.setAdUnitId(this.getString(R.string.app_ad));
    this.mInterstitialAd.setAdListener(this.mAdListener);
    this.mInterstitialAd.loadAd(new AdRequest.Builder().build());

    return rootView;
}
项目:passcodeview    文件CustomPasscodeAdapter.java   
@Override
public View getView(int position,View convertView,ViewGroup parent) {

    PasscodeItem item = getItem(position);

    if(convertView == null || convertView.getTag() != PasscodeItem.class){
        convertView = inflater.inflate(R.layout.button_passcode_custom,false);
        convertView.setTag(PasscodeItem.class);
    }

    AppCompatButton button = (AppCompatButton) convertView;
    button.setText(item.getValue());
    button.setVisibility(item.getType() == PasscodeItem.TYPE_EMPTY ? View.INVISIBLE : View.VISIBLE);

    return convertView;

}
项目:clicker-android    文件FreeResponseActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_free_response);

    vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);

    question = getIntent().getParcelableExtra("question");

    answer = (EditText) findViewById(R.id.response);
    timeRemaining = (TimerView) findViewById(R.id.timeRemaining);
    content = (LinearLayout) findViewById(R.id.content);
    root = (LinearLayout) findViewById(R.id.root);
    submit = (AppCompatButton) findViewById(R.id.submit);
    questionText = (TextView) findViewById(R.id.question);

    submit.setonClickListener(this);

    setQuestion(question);
}
项目:clicker-android    文件NumericResponseActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_numeric_response);

    vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);

    question = getIntent().getParcelableExtra("question");

    response = (EditText) findViewById(R.id.response);
    numpad = (DecimalInputView) findViewById(R.id.numpad);
    timeRemaining = (TimerView) findViewById(R.id.timeRemaining);
    root = (LinearLayout) findViewById(R.id.root);
    content = (LinearLayout) findViewById(R.id.content);
    submit = (AppCompatButton) findViewById(R.id.submit);
    questionText = (TextView) findViewById(R.id.question);

    InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(response.getwindowToken(),0);

    submit.setonClickListener(this);

    if (question != null) {
        setQuestion(question);
    }
}
项目:android-support-learn    文件AppCompatButtonActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_compat_button_layout);
    this.btncompat = (AppCompatButton) findViewById(R.id.btn_compat);

    this.btncompat.setonClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            ColorStateList lists = getResources().getColorStateList(android.R.color.holo_red_light);
            ViewCompat.setBackgroundTintList(btncompat,lists);
            ViewCompat.setBackgroundTintMode(btncompat,PorterDuff.Mode.SRC_IN);
        }
    });

}
项目:Android-Course-Samples    文件FirstFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,Bundle savedInstanceState) {

    View fl = inflater.inflate(R.layout.fragment_first,false);

    button = (AppCompatButton) fl.findViewById(R.id.button);
    button.setonClickListener(this);

    textView1 = (AppCompatTextView) fl.findViewById(R.id.textView1);
    textView1.setText(mParam1);
    textView2 = (AppCompatTextView) fl.findViewById(R.id.textView2);
    textView2.setText(mParam2);
    // Inflate the layout for this fragment
    return fl;
}
项目:multistatetogglebutton    文件MultiStatetoggleButton.java   
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);
        }
    }
}
项目:collect-mobile    文件CodeAttributeComponent.java   
private void includeDescriptionsButton() {
    View inputView = toInputView();
    ViewGroup parent = (ViewGroup) inputView.getParent();
    if (parent == null)
        return;
    if (parent.findViewWithTag(DESCRIPTION_BUTTON_TAG) == null) {
        Button button = new AppCompatButton(context);
        button.setTextAppearance(context,android.R.style.TextAppearance_Small);
        button.setTag(DESCRIPTION_BUTTON_TAG);
        button.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT,WRAP_CONTENT));
        button.setText(context.getResources().getString(R.string.label_show_code_descriptions));
        button.setBackgroundDrawable(null);
        button.setPaintFlags(button.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
        button.setonClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                CodeListDescriptionDialogFragment.show(context.getSupportFragmentManager());
            }
        });
        int linkColor = new TextView(context).getLinkTextColors().getDefaultColor();
        button.setTextColor(linkColor);
        parent.addView(button);
    }
}
项目:collect-mobile    文件CodeAttributeCollectionComponent.java   
private void includeDescriptionsButton() {
    View inputView = toInputView();
    ViewGroup parent = (ViewGroup) inputView.getParent();
    if (parent.findViewWithTag(DESCRIPTION_BUTTON_TAG) == null) {
        Button button = new AppCompatButton(context);
        button.setTextAppearance(context,WRAP_CONTENT));
        button.setText("Show code descriptions");
        button.setBackgroundDrawable(null);
        button.setPaintFlags(button.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
        button.setonClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                CodeListDescriptionDialogFragment.show(context.getSupportFragmentManager());
            }
        });
        int linkColor = new TextView(context).getLinkTextColors().getDefaultColor();
        button.setTextColor(linkColor);
        parent.addView(button);

    }
}
项目:collect-mobile    文件CoordinateAttributeComponent.java   
private Button createNavigationButton() {
    Button button = new AppCompatButton(context);
    button.setTextAppearance(context,android.R.style.TextAppearance_Small);
    button.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT,WRAP_CONTENT));
    button.setText(context.getResources().getString(R.string.label_navigate));
    button.setBackgroundDrawable(null);
    button.setPaintFlags(button.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
    button.setonClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            NavigationDialogFragment.show(context.getSupportFragmentManager());
        }
    });
    int linkColor = new TextView(context).getLinkTextColors().getDefaultColor();
    button.setTextColor(linkColor);
    return button;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。