-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
330 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
<manifest xmlns:android="https://schemas.android.com/apk/res/android" | ||
package="com.yc.ycutilslibrary" > | ||
package="com.yc.ycutilslibrary"> | ||
|
||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
|
||
<application android:allowBackup="true"> | ||
<provider | ||
android:name="android.support.v4.content.FileProvider" | ||
android:authorities="${applicationId}.fileprovider" | ||
android:grantUriPermissions="true" | ||
android:exported="false"> | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/file_paths" /> | ||
</provider> | ||
<activity android:name=".action.YcCropActivity"/> | ||
|
||
<activity android:name=".action.YcCropActivity" /> | ||
</application> | ||
</manifest> |
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
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
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
84 changes: 84 additions & 0 deletions
84
ycutilslibrary/src/main/java/com/yc/ycutilslibrary/common/YcResources.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.yc.ycutilslibrary.common; | ||
|
||
import android.content.res.Resources; | ||
import android.graphics.Color; | ||
import android.graphics.drawable.Drawable; | ||
import android.os.Build; | ||
import android.support.annotation.RequiresApi; | ||
|
||
import com.yc.yclibrary.YcInit; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
/** | ||
* 用于获取资源(需初始化YcUtilsInit.init(x)) | ||
*/ | ||
|
||
public class YcResources { | ||
|
||
private static Resources getResources() { | ||
return YcInit.getContext().getResources(); | ||
} | ||
|
||
/** | ||
* 获取颜色值 | ||
* | ||
* @param resId 颜色资源id | ||
* @return 颜色值 | ||
*/ | ||
public static int getColor(int resId) { | ||
return getResources().getColor(resId); | ||
} | ||
|
||
/** | ||
* 获取颜色值 | ||
* | ||
* @param color 十六进制 | ||
* @return | ||
*/ | ||
public static int getColor(String color) { | ||
return Color.parseColor(color); | ||
} | ||
|
||
/** | ||
* 获取Drawable | ||
* | ||
* @param resTd Drawable资源id | ||
* @return Drawable | ||
*/ | ||
public static Drawable getDrawable(int resTd) { | ||
return getResources().getDrawable(resTd); | ||
} | ||
|
||
/** | ||
* 获取字符串 | ||
* | ||
* @param resId 字符串资源id | ||
* @return 字符串 | ||
*/ | ||
public static String getString(int resId) { | ||
return getResources().getString(resId); | ||
} | ||
|
||
/** | ||
* 获取字符串数组 | ||
* | ||
* @param resId 数组资源id | ||
* @return 字符串数组 | ||
*/ | ||
public static String[] getStringArray(int resId) { | ||
return getResources().getStringArray(resId); | ||
} | ||
|
||
/** | ||
* 获取字符串数组 | ||
* | ||
* @param resId 数组资源id | ||
* @return 字符串数组 | ||
*/ | ||
public static List<String> getStringList(int resId) { | ||
return Arrays.asList(getResources().getStringArray(resId)); | ||
} | ||
} |
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
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
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
Oops, something went wrong.