Time of Update: 2017-01-19
檔案main.java複製代碼 代碼如下:package com.HHBrowser.android;import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.util.Log;import android.view.View;import android.webkit.WebView;import
Time of Update: 2017-01-19
1.概述 最近一直到在帶實習生,因為人比較多,所以很長一段時間沒有更新部落格了,今天更新一篇雷達掃描附近好友效果,以後盡量每周更新一篇,先看一下效果: 2.實現 1、效果分析 效果分為兩個部分,一個是上半部分的自訂RadarView,還有就是下半部分的ViewPager,至於怎麼做到縮放和背景虛化的效果大家可以去看看LazyViewPager這裡不詳細介紹,這裡主要實現掃描效果部分。2、掃描效果實現
Time of Update: 2017-01-19
馬上到雙十一,紅包來襲,時間又是充裕,搶紅包的時候意外發現了百度的福袋介面還不錯,想想還要專門寫一篇博文來完成其介面。當然啦,這其實就是解鎖介面的進化版本。不過其包含的知識點還是挺多的,寫篇博文記錄一下看看具體有哪些技術點啦。看看百度的效果圖:1.編程思路看看介面,不難發現,其就是一個放入九張圖片的容器,繪製其實可以在其上面另建立一個透明View負責繪製線與圓圈。下面我們將介紹一下實現過程。㈠自訂ViewGroup我們知道,自訂ViewGroup一定需要實現其onLayout()方法。該方法是設
Time of Update: 2017-01-19
1.概述 最近一直都在帶實習生做項目,發現自己好久沒有寫部落格了,這幾天更新會比較頻繁,今天玩QQ的時候發現QQ首頁菜單滑動效果早就變了,實在忍不住晚上就來實現一下了! 2.實現 2.1. 實現的方式多種多樣 2.1.1 自訂ViewGroup ,處理其onTouch事件 2.1.2 FrameLayout + 手勢處理類GestureDetector 2.2.3 使用Google內建的DrawerLayout 對其進行修改
Time of Update: 2017-01-19
在控制項ID正確的情況下,檢查是否在執行個體化布局檔案之後,擷取LISTVIEW,先inflate找layout下布局檔案,並執行個體化後才能獲得Listview的IDdemo:public class FragmentPage extends Fragment { View view = null; @Override @SuppressLint("HandlerLeak") public View onCreateView(LayoutInflater inflater,
Time of Update: 2017-01-19
Android
Time of Update: 2017-01-19
複製代碼 代碼如下: Configuration config = getResources().getConfiguration(); if (config.orientation == Configuration.ORIENTATION_LANDSCAPE){ //橫屏,比如 480x320 }else if(config.orientation == Configuration.ORIENTATION_PORTRAIT){ //豎屏 ,標準模式 320x480 }else
Time of Update: 2017-01-19
去掉標題列:requestWindowFeature(Window.FEATURE_NO_TITLE);API上是這麼說的:int FEATURE_NO_TITLE Flag for the "no title" feature, turning off the title at the top of the
Time of Update: 2017-01-19
需要引入ksoap2-android-assembly-2.5.2-jar-with-dependencies.jar複製代碼 代碼如下: //WebService的命名空間 static final String namespace = "http://impl.service.suncreate.com"; //伺服器發布的url static final String url =
Time of Update: 2017-01-19
後台代碼複製代碼 代碼如下: private void ChangeView() { ly.removeAllViews(); LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_
Time of Update: 2017-01-19
Android提供了Invalidate方法實現介面重新整理,但是Invalidate不能直接線上程中調用,因為他是違背了單執行緒模式:Android
Time of Update: 2017-01-19
複製代碼 代碼如下:package com.aslibra.test; import android.app.Activity; import android.graphics.Rect; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.widget.ImageView; public class test extends Activity {
Time of Update: 2017-01-19
複製代碼 代碼如下:findViewById(R.id.myButton).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Do stuff
Time of Update: 2017-01-19
網路上傳言HTC的HERO-ROM支援多點觸摸的論證大多源於瀏覽網頁和圖片時,能像IPhone一樣通過手勢來控制頁面的大小。下面的例子是利用現有的API實現HERO瀏覽圖片和網頁的縮放功能。
Time of Update: 2017-01-19
複製代碼 代碼如下:public class PageWidget extends View { private Bitmap foreImage; private Bitmap bgImage; private PointF touchPt; private int screenWidth; private int
Time of Update: 2017-01-19
複製代碼 代碼如下:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gallerylayout" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Gallery android:id="@+id/overview"
Time of Update: 2017-01-19
Android裡有兩個類android.view.GestureDetectorandroid.view.GestureDetector.SimpleOnGestureListener(另外android.widget.Gallery好像是更牛x的OnGestureListener )1)建立一個類繼承SimpleOnGestureListener,HahaGestureDetectorListener可以實現以下event事件。boolean onDoubleTap(MotionEvent
Time of Update: 2017-01-19
在nvram_cust_pack.c中COMMON_NVRAM_EF_SMSAL_COMMON_PARAM_DEFAULT 複製代碼 代碼如下: kal_uint8 const COMMON_NVRAM_EF_SMSAL_COMMON_PARAM_DEFAULT[] = { #if defined (__CS_SERVICE__) && defined (__SMS_OVER_PS_SUPPORT__) 0x03, /* bearer service : GSM prefer */ #elif
Time of Update: 2017-01-19
很多網友可能發現Android中除了Service還有一個IntentService,他們之間到底有哪些區別呢? 在繼承關係上而言IntentService是Service的子類,內部實現的代碼中涉及到一些Android入門開發人員不瞭解的Looper,Android123在早期的文章中已經說明他們的用法,這裡不再贅述,有關原理大家可以看源碼實現如下: 複製代碼 代碼如下:public abstract class
Time of Update: 2017-01-19
Android中的Adapter在自訂顯示列表時非常有用,比如SimpleAdapter,它的建構函式是: public SimpleAdapter (Context context, List> data, int resource, String[] from, int[]