mirror of
https://github.com/moparisthebest/android-app
synced 2025-01-11 13:18:00 -05:00
adding progress indicator to article.
This commit is contained in:
parent
65089ff16c
commit
06066378d2
@ -33,6 +33,7 @@
|
|||||||
android:id="@+id/btnMarkRead"
|
android:id="@+id/btnMarkRead"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:text="@string/btnMarkRead" />
|
android:text="@string/btnMarkRead" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -19,7 +19,10 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.webkit.WebChromeClient;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
@ -37,6 +40,8 @@ public class ReadArticle extends Activity {
|
|||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||||
|
requestWindowFeature(Window.FEATURE_PROGRESS);
|
||||||
setContentView(R.layout.article);
|
setContentView(R.layout.article);
|
||||||
view = (ScrollView) findViewById(R.id.scroll);
|
view = (ScrollView) findViewById(R.id.scroll);
|
||||||
ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext());
|
ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext());
|
||||||
@ -86,9 +91,20 @@ public class ReadArticle extends Activity {
|
|||||||
"</html>";
|
"</html>";
|
||||||
|
|
||||||
|
|
||||||
webViewContent = (WebView)findViewById(R.id.webViewContent);
|
setProgressBarIndeterminateVisibility(true);
|
||||||
webViewContent.loadDataWithBaseURL("file:///android_asset/", htmlHeader + htmlContent + htmlFooter, "text/html", "utf-8", null);
|
setProgressBarVisibility(true);
|
||||||
|
|
||||||
|
webViewContent = (WebView)findViewById(R.id.webViewContent);
|
||||||
|
webViewContent.setWebChromeClient(new WebChromeClient() {
|
||||||
|
public void onProgressChanged(WebView view, int progress) {
|
||||||
|
setProgress(progress * 100);
|
||||||
|
if(progress == 100) {
|
||||||
|
setProgressBarIndeterminateVisibility(false);
|
||||||
|
setProgressBarVisibility(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
webViewContent.loadDataWithBaseURL("file:///android_asset/", htmlHeader + htmlContent + htmlFooter, "text/html", "utf-8", null);
|
||||||
|
|
||||||
btnMarkRead = (Button)findViewById(R.id.btnMarkRead);
|
btnMarkRead = (Button)findViewById(R.id.btnMarkRead);
|
||||||
btnMarkRead.setOnClickListener(new OnClickListener() {
|
btnMarkRead.setOnClickListener(new OnClickListener() {
|
||||||
|
Loading…
Reference in New Issue
Block a user