@OnCreate
{
// FullScreen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}// XML : @OnCreate
{
// FullScreen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}// XML : <activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="orientation"
android:screenOrientation="portrait"
>// Circle ImageView Function (Could be custom rounded)
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap
.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());// string.xml PART
<string name="name0">Kuray OGUN</string>
<string name="nickname">FreakyCoder</string>
// In JAVA, getting the strings from string.xml
String name = getResources().getString(R.string.name0);
String nickname = getResources().getString(R.string.nickname);// Prevent to auto popping keyboard
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);// How to close scrollMode in RecyclerView
<android.support.v7.widget.RecyclerView
android:id="@+id/ssm_recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
/>| //Here's a runnable/handler combo | |
| Runnable mMyRunnable = new Runnable() | |
| { | |
| @Override | |
| public void run() | |
| { | |
| //Your function or code segment will be here ! | |
| } | |
| }; |
| //Initializing Country List | |
| final List<Country> countryList=new ArrayList<>(); | |
| public void fillCountryList(){ | |
| String[] countries = Locale.getISOCountries(); | |
| int j = 0; | |
| // Loop each country | |
| for(int i = 0; i < countries.length; i++) { |
| listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |
| @Override | |
| public void onItemClick(AdapterView<?> parent, View view, int position, long id) { | |
| TextView tv = (TextView) view.findViewById(R.id.country_name); | |
| String country = tv.getText().toString(); | |
| } | |
| } |
public class ColorfulSnackbar {
private static final int red = Color.parseColor("#f41515");
private static final int green = 0xff4caf50;
private static final int blue = 0xff2195f3;
private static final int orange = 0xffffc107;
private static final int myBlue = Color.parseColor("#002487");
private static View getSnackBarLayout(Snackbar snackbar) {