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
| private int mSourceId; | |
| private int mDstWidth; | |
| private int mDstHeight; | |
| onCreate: | |
| ======== | |
| mSourceId = R.drawable.image; | |
| mDstWidth = getResources().getDimensionPixelSize(R.dimen.destination_width); | |
| mDstHeight = getResources().getDimensionPixelSize(R.dimen.destination_height); | |
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
| private void getVersion(final String apkpath) { | |
| final PackageManager packageManager = getPackageManager(); | |
| if(new File(apkpath).exists()) { | |
| PackageInfo packageInfo = packageManager.getPackageArchiveInfo(apkpath, 0); | |
| Log.d(TAG, "PackageVesrionName: " + packageInfo.versionName); | |
| Log.d(TAG, "PackageVersionCode: " + packageInfo.versionCode); | |
| } | |
| } | |
| Passing Path: |
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
| //Format | |
| public static final String PLANNED_ = "dd-MMM-yyyy"; | |
| public static final String ENTRY_DATE = "dd/MM/yyyy HH:mm:ss"; | |
| //Using JodaTime | |
| public String convertTo(final String passedDate, final String oldPattern, final String newPattern) { | |
| String fullName = ""; | |
| DateTimeFormatter formatter = DateTimeFormat.forPattern(oldPattern); | |
| DateTime jodaTime = formatter.parseDateTime(passedDate); | |
| formatter = DateTimeFormat.forPattern(newPattern); |
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 moc.nahba.diord.utils; | |
| public class Key { | |
| private final int x;//Row | |
| private final int y;//Column | |
| public Key(int x, int y) { | |
| this.x = x; | |
| this.y = y; | |
| } |
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="PauseDialog" parent="@android:style/Theme.Dialog"> | |
| <item name="android:windowAnimationStyle">@style/PauseDialogAnimation</item> | |
| </style> | |
| <style name="PauseDialogAnimation"> | |
| <item name="android:windowEnterAnimation">@anim/bounce_scale</item> | |
| <item name="android:windowExitAnimation">@anim/bounce_minimize</item> | |
| </style> | |
| <style name="DialogActivity" parent="android:Theme.Dialog"> | |
| <item name="android:windowFrame">@null</item> | |
| <item name="android:windowIsFloating">true</item> |
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
| @Override | |
| public boolean onKeyDown(int keyCode, KeyEvent keyEvent) { | |
| if ((CompatibilityUtil.getSdkVersion() < | |
| android.os.Build.VERSION_CODES.ECLAIR) | |
| && keyCode == KeyEvent.KEYCODE_BACK | |
| && keyEvent.getRepeatCount() == 0) { | |
| onBackPressed(); | |
| } | |
| return super.onKeyDown(keyCode, keyEvent); |
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
| @Override | |
| protected void onStart() { | |
| super.onStart(); | |
| boolean isRunning = isServiceRunning(BackgroundService.class); | |
| if(isRunning) { | |
| Intent serviceIntent = new Intent(this, BackgroundService.class); | |
| stopService(serviceIntent); | |
| } | |
| } |
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
| viewHolder.radioGroup.setOnCheckedChangeListener(null); //Most Important Thing To Write O/W Won't Work | |
| if(radioModel.getCheckedId() == 0) { | |
| viewHolder.radioGroup.check(R.id.radioOne); | |
| } else if(radioModel.getCheckedId() == 1) { | |
| viewHolder.radioGroup.check(R.id.radioTwo); | |
| } else if(radioModel.getCheckedId() == 2) { | |
| viewHolder.radioGroup.check(R.id.radioThree); | |
| } | |
| viewHolder.radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { | |
| @Override |
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
| private List<Employee> firstArrayList; | |
| private List<Employee> getFirstArrayList() { | |
| List<Employee> arrayList = new ArrayList<Employee>(); | |
| arrayList.add(new Employee(1, "Donut")); | |
| arrayList.add(new Employee(2, "Froyo")); | |
| arrayList.add(new Employee(3, "Eclair")); | |
| arrayList.add(new Employee(4, "Gingerbread")); | |
| arrayList.add(new Employee(5, "HoneyComb")); | |
| arrayList.add(new Employee(6, "IceCream Sandwich")); | |
| arrayList.add(new Employee(7, "Jelly Bean")); |
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 class ConversionUtils { | |
| public static int convertHexToDecimal(String hexCode) { | |
| return Integer.parseInt(hexCode, 16); | |
| } | |
| public static String convertDecimalToHex(int decCode) { | |
| return Integer.toHexString(decCode); | |
| } |
OlderNewer