Android Open Source - STweaks Syh Button






From Project

Back to project page STweaks.

License

The source code is released under:

GNU General Public License

If you think the Android project STweaks 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.gokhanmoral.stweaks.app;
//  www.j  a v  a  2 s  .c o m
import com.gokhanmoral.stweaks.app.R;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class SyhButton extends SyhControl implements OnClickListener{

  protected SyhButton(Activity activityIn) {
    super(activityIn);
    canGetValueFromScript = false;
  }
  
  private Button button;
  public String label;

  @Override
  public void onClick(View v) {
    String res = setValueViaScript();
         Toast.makeText(context, res, Toast.LENGTH_LONG).show();
  }

  @Override
  protected void createInternal() {
    valueFromScript = "";
    valueFromUser = "";
    
    //create Button from xml template
    View temp = LayoutInflater.from(context).inflate(R.layout.template_button, controlLayout, false);
    button = (Button) temp.findViewById(R.id.SyhButton);
    button.setText(label);
    button.setOnClickListener(this);
    controlLayout.addView(temp);  
  }

  @Override
  protected void applyScriptValueToUserInterface() {
    valueFromUser = valueFromScript;
  }

  @Override
  protected String getDefaultValue() {
    return null;
  }


}




Java Source Code List

com.gokhanmoral.stweaks.app.MainActivity.java
com.gokhanmoral.stweaks.app.SyhButton.java
com.gokhanmoral.stweaks.app.SyhCheckBox.java
com.gokhanmoral.stweaks.app.SyhControl.java
com.gokhanmoral.stweaks.app.SyhExtrasTab.java
com.gokhanmoral.stweaks.app.SyhPane.java
com.gokhanmoral.stweaks.app.SyhSeekBar.java
com.gokhanmoral.stweaks.app.SyhSpinner.java
com.gokhanmoral.stweaks.app.SyhTab.java
com.gokhanmoral.stweaks.app.SyhValueChangedInterface.java
com.gokhanmoral.stweaks.app.Utils.java