This file contains 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
<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_below="@id/notice_item_tv_time" | |
android:layout_alignBottom="@id/notice_item_fl_avatar" | |
android:layout_toRightOf="@id/notice_item_fl_avatar" | |
android:orientation="horizontal" > | |
<Button |
This file contains 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
public class CameraPictureUtil { | |
private static final String TAG = "CameraPictureUtil"; | |
public static final int RESULTCODE_IMAGE_LOCATION = 100, RESULT_FILE_LOCATION = 102, | |
RESULTCODE_IMAGE_CAMERA = 101; | |
// 获取相机拍摄图片 | |
public static String cameraImage(Activity activity) { | |
if (!LocalFileUtil.checkSdCardMount(activity)) { | |
return null; | |
} |
This file contains 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
// stop landscape on QVGA/HVGA | |
int screenSize = getResources().getConfiguration().screenLayout | |
& Configuration.SCREENLAYOUT_SIZE_MASK; | |
if (screenSize == Configuration.SCREENLAYOUT_SIZE_SMALL) { | |
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); | |
} |
This file contains 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.discoverlistview.xy.discoverlistview; | |
import android.content.Context; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewConfiguration; | |
import android.view.ViewGroup; | |
import android.view.animation.AccelerateInterpolator; |
This file contains 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
/** | |
* @return Whether it is possible for the child view of this layout to | |
* scroll up. Override this if the child view is a custom view. | |
*/ | |
public boolean canChildScrollUp() { | |
if (android.os.Build.VERSION.SDK_INT < 14) { | |
if (mTarget instanceof AbsListView) { | |
final AbsListView absListView = (AbsListView) mTarget; | |
return absListView.getChildCount() > 0 | |
&& (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0) |
This file contains 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
http://blog.denevell.org/android-viewdraghelper-example-tutorial.html |
This file contains 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
public static Bitmap getViewBitmap(View v) { | |
v.clearFocus(); | |
v.setPressed(false); | |
boolean willNotCache = v.willNotCacheDrawing(); | |
v.setWillNotCacheDrawing(false); | |
// Reset the drawing cache background color to fully transparent | |
// for the duration of this operation | |
int color = v.getDrawingCacheBackgroundColor(); |
This file contains 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
protected void cancelContentTouch() { | |
final long now = SystemClock.uptimeMillis(); | |
final MotionEvent cancelEvent = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0); | |
final int childCount = getChildCount(); | |
for (int i = 0; i < childCount; i++) { | |
getChildAt(i).dispatchTouchEvent(cancelEvent); | |
} | |
mContentContainer.dispatchTouchEvent(cancelEvent); | |
cancelEvent.recycle(); | |
} |
This file contains 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
WebSettings settings = webView.getSettings(); | |
settings.setJavaScriptEnabled(true); | |
settings.setLoadsImagesAutomatically(true); | |
settings.setBuiltInZoomControls(false); | |
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.KITKAT) { | |
settings.setUseWideViewPort(true); | |
}else { | |
settings.setUseWideViewPort(false); | |
} |
This file contains 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
public class WebFragment extends Fragment implements OnRefreshListener<WebView> { | |
public static final String TAG = "WebFragment"; | |
public static final String URL = "url"; | |
public static final String IS_SINGLE_COLUMN = "is_single_column"; | |
private String url; | |
PullToRefreshWebView refreshWebView; | |
private WebView webView; | |
private ProgressBar progressBar; | |
private boolean isSingleColumn; | |
private ValueCallback<Uri> mUploadMessage; |
NewerOlder