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 xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/mainLayout" | |
android:descendantFocusability="beforeDescendants" | |
android:focusableInTouchMode="true" > | |
<EditText | |
android:id="@+id/password" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" |
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 GradientDrawable getRoundDrawable(Context context, int solidColor, int strokeColor) { | |
GradientDrawable drawable = new GradientDrawable(); | |
drawable.setShape(GradientDrawable.RECTANGLE); | |
drawable.setStroke(3, context.getResources().getColor(strokeColor)); | |
drawable.setCornerRadius(6); | |
drawable.setColor(context.getResources().getColor(solidColor)); | |
drawable.mutate(); | |
return drawable; | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<solid | |
android:angle="270" | |
android:color="@color/color_F9F9F9" /> | |
<corners android:radius="5px"/> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> | |
<stroke | |
android:width="1dp" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<corners | |
android:radius="5px"/> | |
/> | |
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" /> | |
<solid android:color="@color/white"></solid> | |
</shape> |
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 FCM { | |
public static final String SERVER_KEY = "DEFINE_FCM_SERVER_KEY"; | |
public static final String DEVICE_TOKEN = "DEFINE_DEVICE_TOKEN"; | |
/** | |
* use new NotificationTask().execute(); | |
* to send notification | |
*/ |
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
private String cameraFileName; | |
public static final int CHOICE_AVATAR_FROM_CAMERA = 0; | |
public static final int CHOICE_AVATAR_FROM_GALLERY = 1; | |
public static final int CHOICE_AVATAR_FROM_CAMERA_CROP = 3; | |
public void choiceAvatarFromCamera() { | |
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
cameraFileName = "file" + System.currentTimeMillis() + ".png"; | |
File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC), cameraFileName); | |
if(!file.exists()){ |
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
class DownloadMusicFile extends AsyncTask<String, String, String> { | |
@Override | |
protected String doInBackground(String... musicURL) { | |
int count; | |
try { | |
URL url = new URL(musicURL[0]); | |
URLConnection connection = url.openConnection(); | |
connection.connect(); | |
InputStream input = new BufferedInputStream(url.openStream(), 8192); |