package com.mhalka.qurantranslationdisplay; import android.app.Activity; import android.os.Bundle; import android.text.method.ScrollingMovementMethod; import android.util.DisplayMetrics; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.TranslateAnimation; import android.widget.TextView; /** * An example full-screen activity that shows and hides the system UI (i.e. * status bar and navigation/system bar) with user interaction. * * @see SystemUiHider */ public class ShowAyah extends Activity { private VerticalMarqueeTextView ayah; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_show_ayah); ayah = (VerticalMarqueeTextView) findViewById(R.id.ayah); ayah.setMovementMethod(new ScrollingMovementMethod()); ayah.pauseMarquee(); ayah.setDuration(150); ayah.setPixelYOffSet(10); // // DisplayMetrics dm = getResources().getDisplayMetrics(); // // TranslateAnimation m_ta = new TranslateAnimation(0f,0f, dm.heightPixels, -1 * (dm.heightPixels)); // // m_ta.setDuration(10000); // m_ta.setInterpolator(new LinearInterpolator()); // m_ta.setRepeatCount(Animation.INFINITE); // // // ayah.startAnimation(m_ta); // Example of use of QuranReader // AssetManager assetManager = getAssets(); // QuranReader reader = new QuranReader(assetManager, "quran_content"); // reader.setChapter(2); // String verseText = reader.getVerse(16); } @Override protected void onResume() { // Start or restart the Marquee if paused. if (ayah.isPaused()) { ayah.resumeMarquee(); } super.onResume(); } @Override protected void onPause() { // Pause the Marquee when the Activity pauses. ayah.pauseMarquee(); super.onPause(); } @Override protected void onDestroy() { ayah.stopMarquee(); super.onDestroy(); } }