This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| xmlns:card_view="http://schemas.android.com/tools" | |
| android:orientation="vertical"> | |
| <include layout="@layout/view_feed_toolbar" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 一、TextView | |
| android:autoLink="all" //自动添加超链接 | |
| 二、代码中添加字体的属性 | |
| SpannableString ss = new SpannableString( | |
| "text_spannable: Manually created spans. Click here to dial the phone."); | |
| //加粗 | |
| ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 39, | |
| Spanned.SPAN_INCLUSIVE_INCLUSIVE); | |
| //特定的字符添加超链接 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final URL location = new URL(FEED_URL); | |
| InputStream stream = null; | |
| try { | |
| Log.i(TAG, "Streaming data from network: " + location); | |
| stream = downloadUrl(location); | |
| updateLocalFeedData(stream, syncResult); | |
| // Makes sure that the InputStream is closed after the app is | |
| // finished using it. | |
| } finally { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Spinner spinner = (Spinner) findViewById(R.id.spinner); | |
| try { | |
| Field popup = Spinner.class.getDeclaredField("mPopup"); | |
| popup.setAccessible(true); | |
| // Get private mPopup member variable and try cast to ListPopupWindow | |
| android.widget.ListPopupWindow popupWindow = (android.widget.ListPopupWindow) popup.get(spinner); | |
| // Set popupWindow height to 500px | |
| popupWindow.setHeight(500); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.betterzw.myapplication; | |
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.util.Log; | |
| import android.view.MotionEvent; | |
| import android.widget.ScrollView; | |
| /** | |
| * Created by betterzw on 16-1-27. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ObjectAnimator 使用的属性介绍: | |
| translationX,translationY: View相对于原始位置的偏移量 | |
| rotation,rotationX,rotationY: 旋转,rotation用于2D旋转角度,3D中用到后两个 | |
| scaleX,scaleY: 缩放比 | |
| x,y: View的最终坐标,是View的left,top位置加上translationX,translationY | |
| alpha: 透明度 | |
| TimeInterplator: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <shape xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:shape="line"> | |
| <stroke | |
| android:color="#C7B299" | |
| android:dashWidth="10px" | |
| android:dashGap="10px" | |
| android:width="1dp"/> | |
| </shape> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--get from googlesamples --> | |
| <!--Material BorderlessImageButton --> | |
| <ImageButton android:id="@+id/secondary_action" | |
| style="?android:borderlessButtonStyle" | |
| android:layout_width="@dimen/standard_touch_target_size" | |
| android:layout_height="match_parent" | |
| android:src="@drawable/ic_action_delete" | |
| android:contentDescription="@string/delete_content_description" /> | |
NewerOlder