2014-01-14 06:45:59 +01:00
|
|
|
package com.mhalka.qurantranslationdisplay;
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.os.Bundle;
|
2014-01-17 06:59:52 +01:00
|
|
|
import android.text.method.ScrollingMovementMethod;
|
2014-01-18 07:38:12 +01:00
|
|
|
import android.util.DisplayMetrics;
|
|
|
|
|
import android.view.animation.Animation;
|
|
|
|
|
import android.view.animation.LinearInterpolator;
|
|
|
|
|
import android.view.animation.TranslateAnimation;
|
2014-01-17 06:59:52 +01:00
|
|
|
import android.widget.TextView;
|
2014-01-14 06:45:59 +01:00
|
|
|
|
2014-01-18 07:38:12 +01:00
|
|
|
|
2014-01-14 06:45:59 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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 {
|
2014-01-18 07:38:12 +01:00
|
|
|
|
|
|
|
|
private VerticalMarqueeTextView ayah;
|
2014-01-14 06:45:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
|
|
|
|
setContentView(R.layout.activity_show_ayah);
|
2014-01-18 07:38:12 +01:00
|
|
|
ayah = (VerticalMarqueeTextView) findViewById(R.id.ayah);
|
2014-01-17 06:59:52 +01:00
|
|
|
ayah.setMovementMethod(new ScrollingMovementMethod());
|
2014-01-18 07:38:12 +01:00
|
|
|
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);
|
|
|
|
|
|
2014-01-14 06:45:59 +01:00
|
|
|
|
2014-01-17 08:44:17 +01:00
|
|
|
// Example of use of QuranReader
|
|
|
|
|
// AssetManager assetManager = getAssets();
|
|
|
|
|
// QuranReader reader = new QuranReader(assetManager, "quran_content");
|
|
|
|
|
// reader.setChapter(2);
|
|
|
|
|
// String verseText = reader.getVerse(16);
|
2014-01-14 06:45:59 +01:00
|
|
|
}
|
2014-01-18 07:38:12 +01:00
|
|
|
|
|
|
|
|
@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();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-14 06:45:59 +01:00
|
|
|
}
|