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
/** | |
* 打开分享选择dialog | |
* @param context | |
* @param message | |
* @param title | |
*/ | |
public static void shareMessageUsedChooser(Context context, String message, String title){ | |
Intent sendIntent = new Intent(); | |
sendIntent.setAction(Intent.ACTION_SEND); |
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.chezanw.wz.widget; | |
import android.content.Context; | |
import android.support.v4.view.ViewPager; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import com.hangox.xlog.XLog; |
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
// Map point based on address | |
Uri location = Uri.parse("geo:0,0?q=1600+Amphitheatre+Parkway,+Mountain+View,+California"); | |
// Or map point based on latitude/longitude | |
// Uri location = Uri.parse("geo:37.422219,-122.08364?z=14"); // z param is zoom level | |
Intent mapIntent = new Intent(Intent.ACTION_VIEW, location); |
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
// Build the intent | |
Uri location = Uri.parse("geo:0,0?q=1600+Amphitheatre+Parkway,+Mountain+View,+California"); | |
Intent mapIntent = new Intent(Intent.ACTION_VIEW, location); | |
// Verify it resolves | |
PackageManager packageManager = getPackageManager(); | |
List<ResolveInfo> activities = packageManager.queryIntentActivities(mapIntent, 0); | |
boolean isIntentSafe = activities.size() > 0; | |
// Start an activity if it's safe |
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
<!-- Base application theme. --> | |
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | |
<!-- Customize your theme here. --> | |
<item name="colorPrimary">#FF3333</item> | |
<!-- darker variant for the status bar and contextual app bars --> | |
<item name="colorPrimaryDark">#FF3333</item> | |
<!-- theme UI controls like checkboxes and text fields --> | |
<item name="colorAccent">#FFF</item> | |
</style> |
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
Why does my Action Bar have a shadow on Android Lollipop? I’ve set android:windowContentOverlay to null. | |
On Lollipop, the action bar shadow is provided using the new elevation API. | |
To remove it, either call getSupportActionBar().setElevation(0), | |
or set the elevation attribute in your Action Bar style. | |
[链接] (http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html) |
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
<style name="tab"> | |
<item name="android:layout_height">wrap_content</item> | |
<item name="android:layout_width">0dp</item> | |
<item name="android:layout_weight">1</item> | |
<item name="android:textSize">14sp</item> | |
<item name="android:button">@null</item> | |
<item name="android:textColor">@color/tab_text_color</item> | |
<item name="android:gravity">center_horizontal</item> | |
<item name="android:paddingLeft">0dp</item> | |
</style> |
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
<android.support.v7.widget.SwitchCompat | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"/> |
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
public static int dpToPx(Context context,float dpValue) { | |
final float scale =context.getResources().getDisplayMetrics().density; | |
return (int) (dpValue * scale + 0.5f); | |
} |
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
View statusBar = getWindow().getDecorView().findViewById(android.R.id | |
.statusBarBackground); | |
statusBar.setBackgroundResource(android.R.color.transparent); |
OlderNewer