textAppearanceHeadline4
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
// https://android.jlelse.eu/how-to-inject-mock-dependencies-into-android-components-using-dagger-androidinjector-e274c8f6a9a6 | |
class TestApplication : Application(), HasSupportFragmentInjector { | |
@Inject | |
lateinit var fragmentInjector: DispatchingAndroidInjector<Fragment> | |
override fun supportFragmentInjector() = fragmentInjector | |
} |
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
@Module | |
abstract class ActivitiesModule { | |
@ContributesAndroidInjector(modules = [MainActivityModule::class]) | |
abstract fun contributeMainActivity(): MainActivity | |
// Other activities come here, same as above. | |
} |
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
Use case | (ldpi) | mdpi | hdpi | xhdpi | xxhdpi | xxxhdpi | Play Store | |
---|---|---|---|---|---|---|---|---|
Scaling Factors | 0.75 | 1 | 1.5 | 2 | 3 | 4 | ||
Launcher | 48px | 72px | 96px | 144px | 192px | 512px | ||
Preference | 27px | 36px | 54px | 72px | 108px | 144px | ||
BottomNavigation Notification / StatusBar / Overflow Menu | 24px | 36px | 48px | 72px | 96px | |||
Notification Action / ActionBar | 24px | 32px | 48px | 64px | 96px | 128px |
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
@Override | |
public Loader<Cursor> onCreateLoader(int id, Bundle args) { | |
CursorLoader loader = new CursorLoader(getActivity()); | |
if (args != null) { | |
loader.setProjection(args.getStringArray("projection")); | |
loader.setSelection(args.getString("selection")); | |
loader.setSelectionArgs(args.getStringArray("selectionArgs")); | |
loader.setSortOrder(args.getString("sortOrder")); | |
} |
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 CursorAdapter extends AnyAdapter { | |
private int mCount; | |
private Cursor mCursor; | |
private boolean mDataValid; | |
private DataSetObserver mDataSetObserver; | |
public CursorAdapter(Cursor cursor){ | |
super(); | |
mCursor = cursor; |
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
ext.makeVersionCode = { -> | |
try { | |
def code = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-list', 'HEAD', '--count' | |
standardOutput = code | |
} | |
return Integer.parseInt(code.toString().trim()) | |
} | |
catch (ignored) { |
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"?> | |
<project name="git-revision"> | |
<!-- Set your own path if needed --> | |
<property name="git.path">C:\Program Files (x86)\Git\bin\git.exe</property> | |
<property name="manifest.path">AndroidManifest.xml</property> | |
<!-- Generate version code only. Useful if no tags are present yet. --> | |
<target name="version-code"> | |
<exec executable="${git.path}" outputproperty="version.code"> | |
<arg value="rev-list" /> |