Android Open Source - CenteredContentButton Main Activity






From Project

Back to project page CenteredContentButton.

License

The source code is released under:

Apache License

If you think the Android project CenteredContentButton listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.skd.centeredcontentbutton_tabstest;
//from  w w w  . j a  v  a 2 s. c  o m
import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;

import com.skd.centeredcontentbutton.CenteredContentToggleButton;
import com.skd.centeredcontentbutton.CenteredContentToggleGroup;
import com.skd.centeredcontentbutton.CenteredContentToggleGroup.OnCheckedChangeListener;

public class MainActivity extends Activity implements OnCheckedChangeListener {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    
    CenteredContentToggleGroup tabs = (CenteredContentToggleGroup) findViewById(R.id.tabs);
    tabs.setOnCheckedChangeListener(this);
  }

  @Override
  public void onCheckedChanged(CenteredContentToggleGroup group, int checkedId) {
    CenteredContentToggleButton tab = (CenteredContentToggleButton) findViewById(checkedId);
    Toast.makeText(getApplicationContext(), tab.getText() + " selected", Toast.LENGTH_SHORT).show();
  }
  
}




Java Source Code List

com.skd.centeredcontentbutton.CenteredContentButton.java
com.skd.centeredcontentbutton.CenteredContentToggleButton.java
com.skd.centeredcontentbutton.CenteredContentToggleGroup.java
com.skd.centeredcontentbutton_tabstest.MainActivity.java
com.skd.centeredcontentbutton_toggletest.MainActivity.java
com.skd.centeredcontentbuttontest.MainActivity.java