Android Open Source - RealTextView Example Main Activity






From Project

Back to project page RealTextView.

License

The source code is released under:

Apache License

If you think the Android project RealTextView 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 org.hardsoftstudio.real.example;
// w  w w .  ja va2s.c  om
import android.os.Bundle;
import android.view.View;
import android.widget.SeekBar;

import com.hardsoftstudio.real.textview.views.RealButton;
import com.hardsoftstudio.real.textview.views.RealTextView;


public class ExampleMainActivity extends BaseActivity implements SeekBar.OnSeekBarChangeListener {

    private final static String EXTRA_TEXT = " more text to add when seekbar is seeked, when the text doesn't fit it resize it";

    private SeekBar mSeekBar;
    private RealTextView mExample1;
    private RealTextView mExample2;
    private RealButton mExample3;
    private RealTextView mExample4;
    private RealButton mExample5;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_activity_example_main);

        mSeekBar = (SeekBar) findViewById(R.id.w_seb_example);
        mSeekBar.setMax(EXTRA_TEXT.length());
        mSeekBar.setOnSeekBarChangeListener(this);
        mExample1 = (RealTextView) findViewById(R.id.w_rtv_example1);
        mExample2 = (RealTextView) findViewById(R.id.w_rtv_example2);
        mExample3 = (RealButton) findViewById(R.id.w_rbut_example3);
        mExample4 = (RealTextView) findViewById(R.id.w_rtv_example4);
        mExample5 = (RealButton) findViewById(R.id.w_rbut_example5);
        mExample4.setIndeterminateLoadingTextView(true);
        mExample5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mExample5.setIndeterminateLoadingButton(true, true, "Loading...");
            }
        });

    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

        if (!fromUser)
            return;

        mExample1.setText(getString(R.string.txt_example1) + EXTRA_TEXT.substring(0, progress));
        mExample2.setText(getString(R.string.txt_example2) + EXTRA_TEXT.substring(0, progress));
        mExample3.setText(getString(R.string.txt_example3) + EXTRA_TEXT.substring(0, progress));
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {

    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {

    }
}




Java Source Code List

com.hardsoftstudio.real.textview.exceptions.RealHtmlTextViewException.java
com.hardsoftstudio.real.textview.utils.AutofitHelper.java
com.hardsoftstudio.real.textview.utils.FontManager.java
com.hardsoftstudio.real.textview.utils.HtmlTagHandler.java
com.hardsoftstudio.real.textview.utils.LocalImageGetter.java
com.hardsoftstudio.real.textview.utils.RealUrl.java
com.hardsoftstudio.real.textview.utils.SizeUtils.java
com.hardsoftstudio.real.textview.utils.UrlImageGetter.java
com.hardsoftstudio.real.textview.views.BaseTextView.java
com.hardsoftstudio.real.textview.views.RealButton.java
com.hardsoftstudio.real.textview.views.RealCheckBox.java
com.hardsoftstudio.real.textview.views.RealEditText.java
com.hardsoftstudio.real.textview.views.RealTextView.java
org.hardsoftstudio.real.example.ApplicationTest.java
org.hardsoftstudio.real.example.BaseActivity.java
org.hardsoftstudio.real.example.ExampleMainActivity.java
org.hardsoftstudio.real.example.HtmlExampleActivity.java
org.hardsoftstudio.real.example.MainActivity.java
org.hardsoftstudio.real.textview.ApplicationTest.java