Toshkent islom universiteti
Download 1.49 Mb. Pdf ko'rish
|
java dasturlash tilida android tizimida milliy resurslarni tashkillashtirish va boshqarish
- Bu sahifa navigatsiya:
- Dastur listing
Viloyatar classlari:
package com.marifat.ResUz; import android.app.Activity; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.Gravity; import android.view.View;
83
import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.webkit.WebView; import android.widget.FrameLayout; import android.widget.Gallery; import android.widget.TabHost;
public class Toshkent extends Activity{
@Override protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
//zoomcontrol
final FrameLayout.LayoutParams ZOOM_params =
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.BOTTOM);
//fullscreen
SharedPreferences getPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
boolean fullscreen = getPrefs.getBoolean("checkfull", false);
if (fullscreen == true)
requestWindowFeature(Window.FEATURE_NO_TITLE); 84
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSC REEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.tabhost);
TabHost tabs = (TabHost)findViewById(R.id.tabhostins);
tabs.setup();
TabHost.TabSpec
spec=tabs.newTabSpec("tag1");
spec.setContent(R.id.webtab1);
WebView web1 = (WebView) findViewById(R.id.webtab1);
FrameLayout mContentView = (FrameLayout) getWindow().
getDecorView().findViewById(android.R.id.content);
final View zoom = web1.getZoomControls();
mContentView.addView(zoom, ZOOM_params);
zoom.setVisibility(View.GONE);
spec.setIndicator("Ma`lumot");
tabs.addTab(spec);
spec=tabs.newTabSpec("tag2");
spec.setContent(R.id.galtab2);
Gallery g = (Gallery)findViewById(R.id.galtab2); 85
g.setAdapter(new ImageAdapter(this));
tabs.addTab(spec);
spec=tabs.newTabSpec("tag3");
spec.setContent(R.id.webtab3);
WebView web2 = (WebView)findViewById(R.id.webtab3);
web2.loadUrl("http://www.mapsofworld.com/uzbekistan/travel/tashkent. html");
spec.setIndicator("Xarita");
tabs.addTab(spec);
tabs.setCurrentTab(0);
}
}
86
87
Download 1.49 Mb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling