本項(xiàng)目是一個(gè)模仿暴風(fēng)影音的UI項(xiàng)目源碼,仿照的界面有菜單頁,主頁,分類頁等,項(xiàng)目內(nèi)的所有數(shù)據(jù)都使用的本地模擬數(shù)據(jù),仿照度一般在大分辨設(shè)備上布局顯示會(huì)有問題,480x800的分辨率應(yīng)該正合適,默認(rèn)編譯版本4.2.2編碼GBK,注釋不多,需要的朋友可以下載看一下。 東湖ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!×××: http://code.662p.com/view/8949.html public class MainActivity extends TabActivity { private SlideMenu slideMenu; private TabHost tabHost; private LayoutInflater inflater; private Intent intent1, intent2, intent3, intent4, intent5, intent6; private long exitTime = 0; private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; private static final int SWIPE_THRESHOLD_VELOCITY = 200; private GestureDetector gestureDetector; View.OnTouchListener gestureListener; int currentView = 0; private static int maxTabIndex = 5; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { if ((System.currentTimeMillis() - exitTime) > 2000) { Toast.makeText(MainActivity.this, "再按一次退出程序", Toast.LENGTH_SHORT).show(); exitTime = System.currentTimeMillis(); } else { finish(); System.exit(0); } return true; } return super.onKeyDown(keyCode, event); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); gestureDetector = new GestureDetector(new MyGestureDetector()); gestureListener = new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if (gestureDetector.onTouchEvent(event)) { return true; } return false; } }; // 抽屜效果 slideMenu = (SlideMenu) findViewById(R.id.slide_menu); ImageView menuImg = (ImageView) findViewById(R.id.slide_firstmenu); menuImg.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub if (slideMenu.isMainScreenShowing()) { slideMenu.openMenu(); } else { slideMenu.closeMenu(); } } }); intent1 = new Intent(MainActivity.this, FirstActivity.class); intent2 = new Intent(MainActivity.this, SecondActivity.class); intent3 = new Intent(MainActivity.this, SecondActivity.class); intent4 = new Intent(MainActivity.this, SecondActivity.class); intent5 = new Intent(MainActivity.this, SecondActivity.class); intent6 = new Intent(MainActivity.this, MoreInformationActivity.class); LayoutInflater inflater = LayoutInflater.from(MainActivity.this); View view1 = inflater.inflate(R.layout.tabitem_1, null); View view2 = inflater.inflate(R.layout.tabitem_2, null); View view3 = inflater.inflate(R.layout.tabitem_3, null); View view4 = inflater.inflate(R.layout.tabitem_4, null); View view5 = inflater.inflate(R.layout.tabitem_5, null); View view6 = inflater.inflate(R.layout.tabitem_6, null); // 創(chuàng)建TabHost // tabHost = (TabHost) findViewById(R.id.tabHost); // tabHost.setup(); tabHost = getTabHost(); TabSpec tabSpec1 = tabHost.newTabSpec("tab1").setIndicator(view1) .setContent(intent1); tabHost.addTab(tabSpec1); TabSpec tabSpec2 = tabHost.newTabSpec("tab2").setIndicator(view2) .setContent(intent2); tabHost.addTab(tabSpec2); TabSpec tabSpec3 = tabHost.newTabSpec("tab3").setIndicator(view3) .setContent(intent3); tabHost.addTab(tabSpec3); TabSpec tabSpec4 = tabHost.newTabSpec("tab4").setIndicator(view4) .setContent(intent4); tabHost.addTab(tabSpec4); TabSpec tabSpec5 = tabHost.newTabSpec("tab5").setIndicator(view5) .setContent(intent5); tabHost.addTab(tabSpec5); TabSpec tabSpec6 = tabHost.newTabSpec("tab6").setIndicator(view6) .setContent(intent6); tabHost.addTab(tabSpec6); Button p_w_picpathButton1 = (Button) findViewById(R.id.p_w_picpathButton1); p_w_picpathButton1.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub // Toast.makeText(MainActivity.this, "123", Toast.LENGTH_SHORT) // .show(); Intent newIntent = new Intent(MainActivity.this, LocalActivity.class); startActivity(newIntent); } }); ImageView slide_menu_history = (ImageView) findViewById(R.id.slide_menu_history); slide_menu_history.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent newIntent = new Intent(MainActivity.this, HistoryActivity.class); startActivity(newIntent); } }); ImageView slide_menu_search = (ImageView) findViewById(R.id.slide_menu_search); slide_menu_search.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent newIntent = new Intent(MainActivity.this, SearchActivity.class); startActivity(newIntent); } }); } // 左右滑動(dòng)剛好頁面也有滑動(dòng)效果 class MyGestureDetector extends SimpleOnGestureListener { @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { TabHost tabHost = getTabHost(); System.out.println("************"); try { if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH) return false; // right to left swipe if (e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { Log.i("test", "right"); if (currentView == maxTabIndex) { currentView = 0; } else { currentView++; } tabHost.setCurrentTab(currentView); } else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) { Log.i("test", "left"); if (currentView == 0) { currentView = maxTabIndex; } else { currentView--; } tabHost.setCurrentTab(currentView); } } catch (Exception e) { } return false; } } @Override public boolean dispatchTouchEvent(MotionEvent event) { if (gestureDetector.onTouchEvent(event)) { event.setAction(MotionEvent.ACTION_CANCEL); } return super.dispatchTouchEvent(event); } @Override public boolean onTouchEvent(MotionEvent event) { // TODO Auto-generated method stub return gestureDetector.onTouchEvent(event); } // @Override // public boolean onCreateOptionsMenu(Menu menu) { // getMenuInflater().inflate(R.menu.activity_main, menu); // return true; // } } |
<ignore_js_op>
運(yùn)行截圖推薦界面
<ignore_js_op>
導(dǎo)航板塊
<ignore_js_op>
搜索框
<ignore_js_op>
電視劇顯示
詳細(xì)說明:http://android.662p.com/thread-5865-1-1.html
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
文章名稱:仿暴風(fēng)影音安卓客戶端應(yīng)用源碼-創(chuàng)新互聯(lián)
轉(zhuǎn)載注明:http://jinyejixie.com/article16/ccphdg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、靜態(tài)網(wǎng)站、Google、App開發(fā)、品牌網(wǎng)站制作、云服務(wù)器
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容