亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

(轉摘)Android騰訊微薄客戶端開發九:博主詳情界

系統 2173 0
(轉摘)Android騰訊微薄客戶端開發九:博主詳情界面篇(廣播,聽眾,收聽)
點擊頂部的標題欄,界面跳轉到此博主的關注界面
(轉摘)Android騰訊微薄客戶端開發九:博主詳情界面篇(廣播,聽眾,收聽)
關注界面,此界面下面的對話和點評以及上面的廣播,聽眾和收聽丑了點,沒時間了,我今天要把博客弄完,美化的事情交給你們了。
Java代碼 復制代碼 ? 收藏代碼
  1. public ? class ?UserInfoActivity? extends ?Activity? implements ?OnItemClickListener{ ??
  2. ???? private ?String?currentNick; ??
  3. ???? private ?String?name; ??
  4. ???? private ?String?origtext; ??
  5. ???? private ?String?timestamp; ??
  6. ???? private ?DataHelper?dataHelper; ??
  7. ???? private ?UserInfo?user; ??
  8. ???? private ?MyWeiboSync?weibo; ??
  9. ???? private ?Handler?handler; ??
  10. ???? private ?AsyncImageLoader?asyncImageLoader;? ??
  11. ???? private ?UserInfoThread?thread; ??
  12. ???? private ?String?weiboid; ??
  13. ???? private ?String?returnJsonStr; ??
  14. ???? private ?JSONObject?dataObj?; ??
  15. ???? private ?ImageView?user_headicon; ??
  16. ???? private ?TextView?user_nick; ??
  17. ???? private ?TextView?user_name; ??
  18. ???? private ?TextView?user_origtext; ??
  19. ???? private ?TextView?user_time; ??
  20. ???? private ?TextView?user_sex; ??
  21. ???? private ?TextView?user_age; ??
  22. ???? private ?TextView?user_location; ??
  23. ???? private ?TextView?user_verifyinfo; ??
  24. ???? private ?Button?user_back_btn; ??
  25. ???? private ?Button?user_dialog_btn; ??
  26. ???? private ?Button?user_message_btn; ??
  27. ???? private ?GridView?gridView; ??
  28. ???? ??
  29. ???? @Override ??
  30. ???? protected ? void ?onCreate(Bundle?savedInstanceState){ ??
  31. ???????? super .onCreate(savedInstanceState); ??
  32. ????????setContentView(R.layout.user_info); ??
  33. ????????setUpViews(); //設置view ??
  34. ????????setUpListeners(); //設置listenter ??
  35. ????????asyncImageLoader?=? new ?AsyncImageLoader(); ??
  36. ????????dataHelper?=? new ?DataHelper(UserInfoActivity. this ); ??
  37. ????????weibo?=? new ?MyWeiboSync(); ??
  38. ????????List<UserInfo>?userList?=?dataHelper.GetUserList( false ); ??
  39. ???????? ??
  40. ????????SharedPreferences?preferences?=?getSharedPreferences( "default_user" ,Activity.MODE_PRIVATE); ??
  41. ????????String?nick?=?preferences.getString( "user_default_nick" ,? "" ); ??
  42. ???????? ??
  43. ???????? if ?(nick?!=? "" )?{ ??
  44. ????????????user?=?dataHelper.getUserByName(nick,userList); ??
  45. ????????} ??
  46. ???????? ??
  47. ????????weibo.setAccessTokenKey(user.getToken()); ??
  48. ????????weibo.setAccessTokenSecrect(user.getTokenSecret()); ??
  49. ???????? ??
  50. ???????? //獲取從上一界面傳遞過來的數據 ??
  51. ????????Intent?intent?=?getIntent(); ??
  52. ????????name?=?intent.getStringExtra( "name" ); ??
  53. ????????currentNick?=?intent.getStringExtra( "nick" ); //昵稱 ??
  54. ????????origtext?=?intent.getStringExtra( "origtext" ); ??
  55. ????????timestamp?=?intent.getStringExtra( "timestamp" ); ??
  56. ????????user_name.setText( "@" +name); ??
  57. ????????user_origtext.setText(origtext); ??
  58. ????????user_time.setText(timestamp); ??
  59. ???????? ??
  60. ????????handler?=? new ?UserInfoHandler(); ??
  61. ????????thread?=? new ?UserInfoThread(); ??
  62. ????????thread.start(); //開啟一個線程獲取數據 ??
  63. ????} ??
  64. ???? ??
  65. ???? private ? void ?setUpViews(){ ??
  66. ????????user_headicon?=?(ImageView)?findViewById(R.id.user_headicon); ??
  67. ????????user_nick?=?(TextView)?findViewById(R.id.user_nick); ??
  68. ????????user_name?=?(TextView)?findViewById(R.id.user_name); ??
  69. ????????user_origtext?=?(TextView)?findViewById(R.id.user_origtext); ??
  70. ????????user_time?=?(TextView)?findViewById(R.id.user_time); ??
  71. ????????user_sex?=?(TextView)?findViewById(R.id.user_sex); ??
  72. ????????user_age?=?(TextView)?findViewById(R.id.user_age); ??
  73. ????????user_location?=?(TextView)?findViewById(R.id.user_location); ??
  74. ????????user_verifyinfo?=?(TextView)?findViewById(R.id.user_verifyinfo); ??
  75. ????????user_back_btn?=?(Button)?findViewById(R.id.user_back_btn); ??
  76. ????????user_dialog_btn?=?(Button)?findViewById(R.id.user_dialog_btn); ??
  77. ????????user_message_btn?=?(Button)?findViewById(R.id.user_message_btn); ??
  78. ????????gridView?=?(GridView)findViewById(R.id.user_grid); ??
  79. ????} ??
  80. ???? ??
  81. ???? private ? void ?setUpListeners(){ ??
  82. ????????gridView.setOnItemClickListener( this ); ??
  83. ????} ??
  84. ???? ??
  85. ???? class ?UserInfoThread? extends ?Thread?{ ??
  86. ???????? @Override ??
  87. ???????? public ? void ?run()?{ ??
  88. ????????????returnJsonStr?=?weibo.getUserInfoByName(weibo.getAccessTokenKey(),?weibo.getAccessTokenSecrect(),?name); ??
  89. ???????????? //通知handler處理數據 ??
  90. ????????????Message?msg?=?handler.obtainMessage(); ??
  91. ????????????handler.sendMessage(msg); ??
  92. ????????} ??
  93. ????} ??
  94. ???? ??
  95. ???? class ?UserInfoHandler? extends ?Handler?{? ??
  96. ???????? @Override ??
  97. ???????? public ? void ?handleMessage(Message?msg){ ??
  98. ????????????Drawable?cachedImage; ??
  99. ???????????? try ?{ ??
  100. ????????????????dataObj?=? new ?JSONObject(returnJsonStr).getJSONObject( "data" ); ??
  101. ????????????????cachedImage?=?asyncImageLoader.loadDrawable(dataObj.getString( "head" )+ "/100" ,user_headicon,? new ?ImageCallback(){ ??
  102. ???????????????????? @Override ??
  103. ???????????????????? public ? void ?imageLoaded(Drawable?imageDrawable,ImageView?imageView,?String?imageUrl)?{ ??
  104. ????????????????????????imageView.setImageDrawable(imageDrawable); ??
  105. ????????????????????} ??
  106. ????????????????}); ??
  107. ???????????????? if ?(cachedImage?==? null )?{ ??
  108. ????????????????????user_headicon.setImageResource(R.drawable.icon); ??
  109. ????????????????}? else ?{ ??
  110. ????????????????????user_headicon.setImageDrawable(cachedImage); ??
  111. ????????????????} ??
  112. ????????????????user_nick.setText(dataObj.getString( "nick" )); ??
  113. ????????????????user_sex.setText(dataObj.getInt( "sex" )== 1 ? "男" : "女" ); ??
  114. ???????????????? if (dataObj.getInt( "birth_year" )!= 0 ){ ??
  115. ????????????????????user_age.setText((Calendar.getInstance().get(Calendar.YEAR)-dataObj.getInt( "birth_year" ))+ "歲" ); ??
  116. ????????????????} ??
  117. ????????????????user_location.setText(dataObj.getString( "location" )); ??
  118. ????????????????String?verifyinfo?=?dataObj.getString( "verifyinfo" ); ??
  119. ???????????????? if (verifyinfo== null || "" .equals(verifyinfo)){ ??
  120. ????????????????????user_verifyinfo.setText( "這家伙很懶,沒留什么" ); ??
  121. ????????????????} else { ??
  122. ????????????????????user_verifyinfo.setText(verifyinfo); ??
  123. ????????????????} ??
  124. ???????????????? final ?List<String>?numsList?=? new ?ArrayList<String>(); ??
  125. ????????????????numsList.add(dataObj.getString( "tweetnum" )); ??
  126. ????????????????numsList.add(dataObj.getString( "fansnum" )); ??
  127. ????????????????numsList.add(dataObj.getString( "idolnum" )); ??
  128. ????????????????gridView.setAdapter( new ?GridAdapter(UserInfoActivity. this ,?numsList)); ??
  129. ????????????}? catch ?(JSONException?e)?{ ??
  130. ????????????????e.printStackTrace(); ??
  131. ????????????} ??
  132. ????????} ??
  133. ????} ??
  134. ???? ??
  135. ???? class ?GridAdapter? extends ?BaseAdapter?{ ??
  136. ???????? private ?Context?context; ??
  137. ???????? private ?LayoutInflater?inflater; ??
  138. ????????List<String>?numList; ??
  139. ???????? ??
  140. ???????? public ?GridAdapter(Context?context,?List<String>?numList)?{ ??
  141. ???????????? super (); ??
  142. ???????????? this .context?=?context; ??
  143. ???????????? this .numList?=?numList; ??
  144. ???????????? this .inflater?=?LayoutInflater.from(context); ??
  145. ????????} ??
  146. ??
  147. ???????? @Override ??
  148. ???????? public ? int ?getCount()?{ ??
  149. ???????????? return ?numList.size(); ??
  150. ????????} ??
  151. ??
  152. ???????? @Override ??
  153. ???????? public ?Object?getItem( int ?position)?{ ??
  154. ???????????? return ?numList.get(position); ??
  155. ????????} ??
  156. ??
  157. ???????? @Override ??
  158. ???????? public ? long ?getItemId( int ?position)?{ ??
  159. ???????????? return ?position; ??
  160. ????????} ??
  161. ??
  162. ???????? @Override ??
  163. ???????? public ?View?getView( final ? int ?position,?View?convertView,?ViewGroup?parent){ ??
  164. ????????????convertView?=?inflater.inflate(R.layout.userinfo_grid_item,? null ); ??
  165. ????????????TextView?num?=?(TextView)convertView.findViewById(R.id.userinfo_grid_num); ??
  166. ????????????TextView?title?=?(TextView)convertView.findViewById(R.id.userinfo_grid_title); ??
  167. ????????????ImageView?image?=?(ImageView)convertView.findViewById(R.id.userinfo_grid_image); ??
  168. ???????????? switch ?(position)?{ ??
  169. ???????????? case ? 0 : ??
  170. ????????????????num.setText(numList.get( 0 )); ??
  171. ????????????????title.setText( "廣播" ); ??
  172. ????????????????image.setVisibility(View.VISIBLE); ??
  173. ???????????????? break ; ??
  174. ???????????? case ? 1 : ??
  175. ????????????????num.setText(numList.get( 1 )); ??
  176. ????????????????title.setText( "聽眾" ); ??
  177. ????????????????image.setVisibility(View.VISIBLE); ??
  178. ???????????????? break ; ??
  179. ???????????? case ? 2 : ??
  180. ????????????????num.setText(numList.get( 2 )); ??
  181. ????????????????title.setText( "收聽" ); ??
  182. ???????????????? break ; ??
  183. ??
  184. ???????????? default : ??
  185. ???????????????? break ; ??
  186. ????????????} ??
  187. ???????????? return ?convertView; ??
  188. ????????} ??
  189. ????} ??
  190. ??
  191. ???? @Override ??
  192. ???? public ? void ?onItemClick(AdapterView<?>?arg0,?View?arg1,? int ?position,? long ?arg3){ ??
  193. ???????? switch ?(position)?{ ??
  194. ???????? case ? 0 : ??
  195. ????????????Intent?intent?=? new ?Intent(UserInfoActivity. this ,TweetsActivity. class ); ??
  196. ????????????intent.putExtra( "name" ,?name); ??
  197. ????????????intent.putExtra( "nick" ,currentNick); ??
  198. ????????????startActivity(intent); ??
  199. ???????????? break ; ??
  200. ???????? case ? 1 : ??
  201. ????????????Intent?intent2?=? new ?Intent(UserInfoActivity. this ,FansActivity. class ); ??
  202. ????????????intent2.putExtra( "name" ,?name); ??
  203. ????????????intent2.putExtra( "nick" ,currentNick); ??
  204. ????????????startActivity(intent2); ??
  205. ???????????? break ; ??
  206. ???????? case ? 2 : ??
  207. ????????????Intent?intent3?=? new ?Intent(UserInfoActivity. this ,IdolActivity. class ); ??
  208. ????????????intent3.putExtra( "name" ,?name); ??
  209. ????????????intent3.putExtra( "nick" ,currentNick); ??
  210. ????????????startActivity(intent3); ??
  211. ???????????? break ; ??
  212. ???????? default : ??
  213. ???????????? break ; ??
  214. ????????} ??
  215. ???????? ??
  216. ????} ??
  217. }??
      public class UserInfoActivity extends Activity implements OnItemClickListener{
	private String currentNick;
	private String name;
	private String origtext;
	private String timestamp;
	private DataHelper dataHelper;
	private UserInfo user;
	private MyWeiboSync weibo;
	private Handler handler;
	private AsyncImageLoader asyncImageLoader; 
	private UserInfoThread thread;
	private String weiboid;
	private String returnJsonStr;
	private JSONObject dataObj ;
	private ImageView user_headicon;
	private TextView user_nick;
	private TextView user_name;
	private TextView user_origtext;
	private TextView user_time;
	private TextView user_sex;
	private TextView user_age;
	private TextView user_location;
	private TextView user_verifyinfo;
	private Button user_back_btn;
	private Button user_dialog_btn;
	private Button user_message_btn;
	private GridView gridView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.user_info);
		setUpViews();//設置view
		setUpListeners();//設置listenter
		asyncImageLoader = new AsyncImageLoader();
		dataHelper = new DataHelper(UserInfoActivity.this);
		weibo = new MyWeiboSync();
		List<UserInfo> userList = dataHelper.GetUserList(false);
		
		SharedPreferences preferences = getSharedPreferences("default_user",Activity.MODE_PRIVATE);
		String nick = preferences.getString("user_default_nick", "");
		
		if (nick != "") {
			user = dataHelper.getUserByName(nick,userList);
		}
		
		weibo.setAccessTokenKey(user.getToken());
		weibo.setAccessTokenSecrect(user.getTokenSecret());
		
		//獲取從上一界面傳遞過來的數據
		Intent intent = getIntent();
		name = intent.getStringExtra("name");
		currentNick = intent.getStringExtra("nick");//昵稱
		origtext = intent.getStringExtra("origtext");
		timestamp = intent.getStringExtra("timestamp");
		user_name.setText("@"+name);
		user_origtext.setText(origtext);
		user_time.setText(timestamp);
		
		handler = new UserInfoHandler();
		thread = new UserInfoThread();
		thread.start();//開啟一個線程獲取數據
	}
	
	private void setUpViews(){
		user_headicon = (ImageView) findViewById(R.id.user_headicon);
		user_nick = (TextView) findViewById(R.id.user_nick);
		user_name = (TextView) findViewById(R.id.user_name);
		user_origtext = (TextView) findViewById(R.id.user_origtext);
		user_time = (TextView) findViewById(R.id.user_time);
		user_sex = (TextView) findViewById(R.id.user_sex);
		user_age = (TextView) findViewById(R.id.user_age);
		user_location = (TextView) findViewById(R.id.user_location);
		user_verifyinfo = (TextView) findViewById(R.id.user_verifyinfo);
		user_back_btn = (Button) findViewById(R.id.user_back_btn);
		user_dialog_btn = (Button) findViewById(R.id.user_dialog_btn);
		user_message_btn = (Button) findViewById(R.id.user_message_btn);
		gridView = (GridView)findViewById(R.id.user_grid);
	}
	
	private void setUpListeners(){
		gridView.setOnItemClickListener(this);
	}
	
	class UserInfoThread extends Thread {
		@Override
		public void run() {
			returnJsonStr = weibo.getUserInfoByName(weibo.getAccessTokenKey(), weibo.getAccessTokenSecrect(), name);
			//通知handler處理數據
			Message msg = handler.obtainMessage();
			handler.sendMessage(msg);
		}
	}
	
	class UserInfoHandler extends Handler { 
		@Override
		public void handleMessage(Message msg){
			Drawable cachedImage;
			try {
				dataObj = new JSONObject(returnJsonStr).getJSONObject("data");
				cachedImage = asyncImageLoader.loadDrawable(dataObj.getString("head")+"/100",user_headicon, new ImageCallback(){
	                @Override
	                public void imageLoaded(Drawable imageDrawable,ImageView imageView, String imageUrl) {
	                    imageView.setImageDrawable(imageDrawable);
	                }
	            });
				if (cachedImage == null) {
					user_headicon.setImageResource(R.drawable.icon);
				} else {
					user_headicon.setImageDrawable(cachedImage);
				}
				user_nick.setText(dataObj.getString("nick"));
				user_sex.setText(dataObj.getInt("sex")==1?"男":"女");
				if(dataObj.getInt("birth_year")!=0){
					user_age.setText((Calendar.getInstance().get(Calendar.YEAR)-dataObj.getInt("birth_year"))+"歲");
				}
				user_location.setText(dataObj.getString("location"));
				String verifyinfo = dataObj.getString("verifyinfo");
				if(verifyinfo==null||"".equals(verifyinfo)){
					user_verifyinfo.setText("這家伙很懶,沒留什么");
				}else{
					user_verifyinfo.setText(verifyinfo);
				}
				final List<String> numsList = new ArrayList<String>();
				numsList.add(dataObj.getString("tweetnum"));
				numsList.add(dataObj.getString("fansnum"));
				numsList.add(dataObj.getString("idolnum"));
				gridView.setAdapter(new GridAdapter(UserInfoActivity.this, numsList));
			} catch (JSONException e) {
				e.printStackTrace();
			}
		}
	}
	
	class GridAdapter extends BaseAdapter {
		private Context context;
		private LayoutInflater inflater;
		List<String> numList;
		
		public GridAdapter(Context context, List<String> numList) {
			super();
			this.context = context;
			this.numList = numList;
			this.inflater = LayoutInflater.from(context);
		}

		@Override
		public int getCount() {
			return numList.size();
		}

		@Override
		public Object getItem(int position) {
			return numList.get(position);
		}

		@Override
		public long getItemId(int position) {
			return position;
		}

		@Override
		public View getView(final int position, View convertView, ViewGroup parent){
			convertView = inflater.inflate(R.layout.userinfo_grid_item, null);
			TextView num = (TextView)convertView.findViewById(R.id.userinfo_grid_num);
			TextView title = (TextView)convertView.findViewById(R.id.userinfo_grid_title);
			ImageView image = (ImageView)convertView.findViewById(R.id.userinfo_grid_image);
			switch (position) {
			case 0:
				num.setText(numList.get(0));
				title.setText("廣播");
				image.setVisibility(View.VISIBLE);
				break;
			case 1:
				num.setText(numList.get(1));
				title.setText("聽眾");
				image.setVisibility(View.VISIBLE);
				break;
			case 2:
				num.setText(numList.get(2));
				title.setText("收聽");
				break;

			default:
				break;
			}
			return convertView;
		}
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3){
		switch (position) {
		case 0:
			Intent intent = new Intent(UserInfoActivity.this,TweetsActivity.class);
			intent.putExtra("name", name);
			intent.putExtra("nick",currentNick);
			startActivity(intent);
			break;
		case 1:
			Intent intent2 = new Intent(UserInfoActivity.this,FansActivity.class);
			intent2.putExtra("name", name);
			intent2.putExtra("nick",currentNick);
			startActivity(intent2);
			break;
		case 2:
			Intent intent3 = new Intent(UserInfoActivity.this,IdolActivity.class);
			intent3.putExtra("name", name);
			intent3.putExtra("nick",currentNick);
			startActivity(intent3);
			break;
		default:
			break;
		}
		
	}
}
    


Java代碼 復制代碼 ? 收藏代碼
  1. <?xml?version= "1.0" ?encoding= "utf-8" ?> ??
  2. <RelativeLayout?android:layout_width= "fill_parent" ?android:layout_height= "fill_parent" ?android:background= "#c0c8d0" ??
  3. ????xmlns:android= "http://schemas.android.com/apk/res/android" > ??
  4. ????<RelativeLayout?android:id= "@+id/user_top" ?android:paddingTop= "5.0dip" ?android:layout_width= "fill_parent" ?android:layout_height= "60.0dip" ?android:layout_alignParentTop= "true" ?android:layout_centerHorizontal= "true" > ??
  5. ????????<ImageView?android:id= "@+id/user_headicon" ?android:layout_marginLeft= "8.0dip" ?android:layout_width= "45.0dip" ?android:layout_height= "45.0dip" ?android:layout_alignParentLeft= "true" /> ??
  6. ????????<TextView?android:id= "@+id/user_nick" ?android:layout_marginLeft= "5.0dip" ?android:layout_width= "wrap_content" ?android:layout_toRightOf= "@id/user_headicon" ?android:textColor= "#384050" ??
  7. ????????????android:layout_height= "wrap_content" /> ??
  8. ????????<TextView?android:id= "@+id/user_name" ?android:layout_width= "wrap_content" ?android:layout_marginLeft= "10.0dip" ?android:layout_toRightOf= "@id/user_headicon" ?android:textColor= "#687888" ??
  9. ????????????android:layout_height= "wrap_content" ?android:layout_below= "@id/user_nick" /> ??
  10. ????</RelativeLayout> ??
  11. ????<LinearLayout?android:paddingLeft= "10.0dip" ?android:paddingRight= "10.0dip" ?android:layout_width= "fill_parent" ?android:layout_height= "wrap_content" ?android:orientation= "vertical" ?android:layout_below= "@id/user_top" > ??
  12. ????????<ImageView?android:background= "#a0b0b0" ?android:layout_width= "fill_parent" ?android:layout_height= "1.0dip" ?android:scaleType= "fitCenter" /> ??
  13. ????????<RelativeLayout?android:layout_width= "fill_parent" ?android:layout_height= "wrap_content" ?android:layout_marginTop= "10.0dip" > ??
  14. ????????????<GridView?android:gravity= "center" ?android:listSelector= "@drawable/listitem_selector" ?android:id= "@+id/user_grid" ?android:background= "@drawable/userinfo_grid_bg" ?android:layout_width= "fill_parent" ?android:layout_height= "wrap_content" ?android:numColumns= "3" /> ??
  15. ????????</RelativeLayout> ??
  16. ????????<RelativeLayout?android:layout_width= "fill_parent" ?android:layout_height= "wrap_content" ?android:layout_marginTop= "10.0dip" ?android:background= "@drawable/panel_bg" > ??
  17. ????????????<TextView?android:id= "@+id/user_sex" ?android:layout_marginLeft= "5.0dip" ?android:layout_alignParentLeft= "true" ?android:layout_width= "wrap_content" ??android:textSize= "12.0sp" ?android:textColor= "#788080" ??
  18. ????????????????android:layout_height= "wrap_content" /> ??
  19. ????????????<TextView?android:id= "@+id/user_age" ?android:layout_toRightOf= "@id/user_sex" ?android:layout_width= "wrap_content" ??android:textSize= "12.0sp" ?android:textColor= "#788080" ??
  20. ????????????????android:layout_height= "wrap_content" /> ??
  21. ????????????<TextView??android:id= "@+id/user_location" ?android:layout_toRightOf= "@id/user_age" ?android:layout_width= "wrap_content" ?android:textSize= "12.0sp" ?android:textColor= "#788080" ??
  22. ????????????????android:layout_height= "wrap_content" /> ??
  23. ????????????<TextView??android:id= "@+id/user_verifyinfo" ?android:layout_marginLeft= "5.0dip" ?android:layout_alignParentLeft= "true" ?android:layout_below= "@id/user_sex" ?android:layout_width= "fill_parent" ?android:textSize= "12.0sp" ?android:textColor= "#788080" ??
  24. ????????????????android:layout_height= "wrap_content" /> ??
  25. ????????</RelativeLayout> ??
  26. ????????<RelativeLayout?android:layout_width= "fill_parent" ?android:layout_height= "wrap_content" ?android:layout_marginTop= "10.0dip" ?android:background= "@drawable/panel_bg" > ??
  27. ????????????<TextView?android:text= "最新廣播:" ?android:layout_width= "fill_parent" ?android:layout_marginLeft= "5.0dip" ?android:textSize= "12.0sp" ?android:textColor= "#788080" ??
  28. ????????????????android:layout_height= "wrap_content" /> ??
  29. ????????????<TextView?android:id= "@+id/user_time" ?android:layout_width= "wrap_content" ?android:layout_marginLeft= "3.0dip" ?android:layout_marginTop= "10.0dip" ?android:textSize= "8.0sp" ?android:textColor= "#788080" ??
  30. ????????????????android:layout_height= "wrap_content" ?android:layout_alignParentRight= "true" /> ??
  31. ????????????<TextView?android:id= "@+id/user_origtext" ?android:layout_width= "fill_parent" ?android:layout_marginLeft= "5.0dip" ?android:textSize= "12.0sp" ?android:textColor= "#788080" ? ??
  32. ????????????????android:layout_height= "wrap_content" ?android:layout_below= "@id/user_time" ?android:layout_alignParentLeft= "true" /> ??
  33. ????????</RelativeLayout> ??
  34. ????</LinearLayout> ??
  35. ????<RelativeLayout?android:layout_width= "fill_parent" ?android:layout_height= "40.0dip" ?android:layout_alignParentBottom= "true" > ??
  36. ????????<Button?android:id= "@+id/user_back_btn" ?android:layout_width= "40.0dip" ?android:drawableTop= "@drawable/btn_back_selector" ?android:background= "@drawable/bottom_back_bg" ??
  37. ????????????android:layout_height= "40.0dip" ??android:layout_alignParentLeft= "true" /> ??
  38. ????????<LinearLayout?android:id= "@+id/widget41" ?android:layout_marginLeft= "60.0dip" ?android:layout_alignParentBottom= "true" ??
  39. ????????????android:layout_width= "wrap_content" ?android:layout_height= "wrap_content" ?android:orientation= "horizontal" ?android:layout_toRightOf= "@id/user_back_btn" > ??
  40. ????????????<ImageView?android:background= "#f8f8f8" ?android:layout_width= "1.0dip" ?android:layout_height= "20.0dip" ?android:scaleType= "fitCenter" /> ??
  41. ????????????<Button?android:id= "@+id/user_dialog_btn" ?android:layout_width= "wrap_content" ?android:background= "@drawable/bottom_bar_bg" ??
  42. ????????????????android:layout_height= "wrap_content" ?android:text= "對話" /> ??
  43. ????????????<ImageView?android:background= "#f8f8f8" ?android:layout_width= "1.0dip" ?android:layout_height= "20.0dip" ?android:scaleType= "fitCenter" /> ??
  44. ????????????<Button?android:id= "@+id/user_message_btn" ?android:layout_width= "wrap_content" ?android:background= "@drawable/bottom_bar_bg" ??
  45. ????????????????android:layout_height= "wrap_content" ?android:text= "點評" /> ??
  46. ????????</LinearLayout> ??
  47. ????????<Button?android:id= "@+id/user_tohome_btn" ?android:layout_width= "40.0dip" ??
  48. ????????????android:layout_height= "40.0dip" ?android:drawableTop= "@drawable/btn_home_selector" ?android:background= "@drawable/bottom_home_bg" ?android:layout_alignParentRight= "true" /> ??
  49. ????</RelativeLayout> ??
  50. </RelativeLayout>??
      <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#c0c8d0"
	xmlns:android="http://schemas.android.com/apk/res/android">
	<RelativeLayout android:id="@+id/user_top" android:paddingTop="5.0dip" android:layout_width="fill_parent" android:layout_height="60.0dip" android:layout_alignParentTop="true" android:layout_centerHorizontal="true">
		<ImageView android:id="@+id/user_headicon" android:layout_marginLeft="8.0dip" android:layout_width="45.0dip" android:layout_height="45.0dip" android:layout_alignParentLeft="true"/>
		<TextView android:id="@+id/user_nick" android:layout_marginLeft="5.0dip" android:layout_width="wrap_content" android:layout_toRightOf="@id/user_headicon" android:textColor="#384050"
			android:layout_height="wrap_content"/>
		<TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_marginLeft="10.0dip" android:layout_toRightOf="@id/user_headicon" android:textColor="#687888"
			android:layout_height="wrap_content" android:layout_below="@id/user_nick"/>
	</RelativeLayout>
	<LinearLayout android:paddingLeft="10.0dip" android:paddingRight="10.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_below="@id/user_top">
		<ImageView android:background="#a0b0b0" android:layout_width="fill_parent" android:layout_height="1.0dip" android:scaleType="fitCenter"/>
		<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10.0dip">
			<GridView android:gravity="center" android:listSelector="@drawable/listitem_selector" android:id="@+id/user_grid" android:background="@drawable/userinfo_grid_bg" android:layout_width="fill_parent" android:layout_height="wrap_content" android:numColumns="3"/>
		</RelativeLayout>
		<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10.0dip" android:background="@drawable/panel_bg">
			<TextView android:id="@+id/user_sex" android:layout_marginLeft="5.0dip" android:layout_alignParentLeft="true" android:layout_width="wrap_content"  android:textSize="12.0sp" android:textColor="#788080"
				android:layout_height="wrap_content"/>
			<TextView android:id="@+id/user_age" android:layout_toRightOf="@id/user_sex" android:layout_width="wrap_content"  android:textSize="12.0sp" android:textColor="#788080"
				android:layout_height="wrap_content"/>
			<TextView  android:id="@+id/user_location" android:layout_toRightOf="@id/user_age" android:layout_width="wrap_content" android:textSize="12.0sp" android:textColor="#788080"
				android:layout_height="wrap_content"/>
			<TextView  android:id="@+id/user_verifyinfo" android:layout_marginLeft="5.0dip" android:layout_alignParentLeft="true" android:layout_below="@id/user_sex" android:layout_width="fill_parent" android:textSize="12.0sp" android:textColor="#788080"
				android:layout_height="wrap_content"/>
		</RelativeLayout>
		<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10.0dip" android:background="@drawable/panel_bg">
			<TextView android:text="最新廣播:" android:layout_width="fill_parent" android:layout_marginLeft="5.0dip" android:textSize="12.0sp" android:textColor="#788080"
				android:layout_height="wrap_content"/>
			<TextView android:id="@+id/user_time" android:layout_width="wrap_content" android:layout_marginLeft="3.0dip" android:layout_marginTop="10.0dip" android:textSize="8.0sp" android:textColor="#788080"
				android:layout_height="wrap_content" android:layout_alignParentRight="true"/>
			<TextView android:id="@+id/user_origtext" android:layout_width="fill_parent" android:layout_marginLeft="5.0dip" android:textSize="12.0sp" android:textColor="#788080" 
				android:layout_height="wrap_content" android:layout_below="@id/user_time" android:layout_alignParentLeft="true"/>
		</RelativeLayout>
	</LinearLayout>
	<RelativeLayout android:layout_width="fill_parent" android:layout_height="40.0dip" android:layout_alignParentBottom="true">
		<Button android:id="@+id/user_back_btn" android:layout_width="40.0dip" android:drawableTop="@drawable/btn_back_selector" android:background="@drawable/bottom_back_bg"
			android:layout_height="40.0dip"  android:layout_alignParentLeft="true"/>
		<LinearLayout android:id="@+id/widget41" android:layout_marginLeft="60.0dip" android:layout_alignParentBottom="true"
			android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_toRightOf="@id/user_back_btn">
			<ImageView android:background="#f8f8f8" android:layout_width="1.0dip" android:layout_height="20.0dip" android:scaleType="fitCenter"/>
			<Button android:id="@+id/user_dialog_btn" android:layout_width="wrap_content" android:background="@drawable/bottom_bar_bg"
				android:layout_height="wrap_content" android:text="對話"/>
			<ImageView android:background="#f8f8f8" android:layout_width="1.0dip" android:layout_height="20.0dip" android:scaleType="fitCenter"/>
			<Button android:id="@+id/user_message_btn" android:layout_width="wrap_content" android:background="@drawable/bottom_bar_bg"
				android:layout_height="wrap_content" android:text="點評"/>
		</LinearLayout>
		<Button android:id="@+id/user_tohome_btn" android:layout_width="40.0dip"
			android:layout_height="40.0dip" android:drawableTop="@drawable/btn_home_selector" android:background="@drawable/bottom_home_bg" android:layout_alignParentRight="true"/>
	</RelativeLayout>
</RelativeLayout>

    


Java代碼 復制代碼 ? 收藏代碼
  1. <?xml?version= "1.0" ?encoding= "utf-8" ?> ??
  2. <LinearLayout?xmlns:android= "http://schemas.android.com/apk/res/android" ?android:gravity= "center" ?android:paddingTop= "3.0dip" ?android:orientation= "horizontal" ?android:layout_width= "wrap_content" ?android:layout_height= "wrap_content" > ??
  3. ????<LinearLayout?android:orientation= "vertical" ?android:layout_width= "wrap_content" ?android:layout_height= "wrap_content" > ??
  4. ????????<TextView?android:id= "@+id/userinfo_grid_num" ?android:layout_width= "wrap_content" ?android:layout_height= "wrap_content" ?android:textColor= "#586068" /> ??
  5. ????????<TextView?android:id= "@+id/userinfo_grid_title" ?android:layout_width= "wrap_content" ?android:layout_height= "wrap_content" ?android:textColor= "#98a0a0" /> ??
  6. ????</LinearLayout> ??
  7. ????<ImageView?android:id= "@+id/userinfo_grid_image" ?android:src= "#d0d0d8" ?android:visibility= "invisible" ?android:layout_width= "1.0dip" ?android:layout_height= "30.0dip" ?android:layout_marginLeft= "30.0dip" /> ??
  8. </LinearLayout>??
  9. http://helloandroid.iteye.com/blog/1136746

(轉摘)Android騰訊微薄客戶端開發九:博主詳情界面篇(廣播,聽眾,收聽)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久亚洲这里只有精品18 | 亚洲国产成人99精品激情在线 | 日韩se| 60欧美老妇做爰视频 | 午夜体验区 | 青青在线成人免费视频 | 中文字幕在亚洲第一在线 | 欧美日韩不卡中文字幕在线 | 色婷婷色婷婷 | 99热这里只有精品66 | 成熟的女性强烈交性视频 | 久久精品入口麻豆 | 亚洲操片 | 亚色视频在线观看 | 国产香蕉视频在线观看 | 四虎影院一级片 | 超级乱淫视频aⅴ播放视频 超级乱淫视频播放日韩 | 日韩欧美在线看 | 国产一区二区三区日韩欧美 | 91香蕉国产亚洲一区二区三区 | 四虎视频国产精品免费入口 | 国产或人精品日本亚洲77美色 | 国产福利不卡视频在免费 | 国产成人综合自拍 | 国产真实乱子伦精品视 | 日本欧美中文字幕 | 中文字幕第一区 | 免费在线视频一区 | 欧美大狠狠大臿蕉香蕉大视频 | 综合欧美日韩 | 四虎精品久久 | 国产激情视频一区二区三区 | 亚州精品永久观看视频 | 天天综合欧美 | 国产精品伦理一二三区伦理 | 香蕉网久久 | 91最新在线观看 | 国产福利精品在线观看 | 久久首页| 香蕉色香蕉在线视频 | 久久99国产综合精品 |