Android Open Source - App-Growth-Engine-Android-TabUI Main Activity






From Project

Back to project page App-Growth-Engine-Android-TabUI.

License

The source code is released under:

Apache License

If you think the Android project App-Growth-Engine-Android-TabUI 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.hookmobile.tabui.sample;
//w w w .  ja v a2s . com
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ToggleButton;

import com.hookmobile.tabui.SmsType;
import com.hookmobile.tabui.TabUI;

public class MainActivity extends Activity {
  
  private String appKey = "Your-App-Key";

  private ToggleButton playToggle;
  private ToggleButton smsTypeToggle;
  private ToggleButton hideTabToggle;
  private Button toggleTabBtn;
  
  private TabUI tab;
  
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);

    tab = new TabUI(this, savedInstanceState, appKey);
    tab.setPlayButtonVisible(true);
    tab.setTabVisible(true);
    TabUI.setSmsType(SmsType.NATIVE);
    
    playToggle = (ToggleButton) findViewById(R.id.toggleButton1);
    playToggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
      public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
        tab.setPlayButtonVisible(checked);
      }
    });
    playToggle.setChecked(true);
    
    smsTypeToggle = (ToggleButton) findViewById(R.id.toggleButton2);
    smsTypeToggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
      public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
        if (checked)
          TabUI.setSmsType(SmsType.NATIVE);
        else
          TabUI.setSmsType(SmsType.VIRTUAL_NUMBER);
      }
    });
    smsTypeToggle.setChecked(true);
    
    hideTabToggle = (ToggleButton) findViewById(R.id.toggleButton3);
    hideTabToggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {
      public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
        tab.setTabVisible(! checked);
      }
    });
    hideTabToggle.setChecked(false);

    toggleTabBtn = (Button) findViewById(R.id.toggletab);
    toggleTabBtn.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
        tab.openTabUI();
      }
    });
  }

  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    tab.onSaveInstanceState(outState);
  }

  @Override
  protected void onPause() {
    super.onPause();
    tab.pause();
  }
  
}




Java Source Code List

com.hookmobile.tabui.FriendsAdapter.java
com.hookmobile.tabui.PhoneBookContact.java
com.hookmobile.tabui.PhoneBookContactsActivity.java
com.hookmobile.tabui.PhoneBookContactsAdapter.java
com.hookmobile.tabui.Playable.java
com.hookmobile.tabui.RecommendedContact.java
com.hookmobile.tabui.RecommendedContactsAdapter.java
com.hookmobile.tabui.SmsType.java
com.hookmobile.tabui.TabUIConstants.java
com.hookmobile.tabui.TabUIUtils.java
com.hookmobile.tabui.TabUI.java
com.hookmobile.tabui.sample.MainActivity.java
com.hookmobile.tabui.sample.SplashScreenActivity.java