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
AppCompat-v7:21 provides a very useful way of dealing with pressed/focused/activated states maintaining backwards compatibility downto API-7, but there's a small issue (big for some) with the default selectableItemBackground: It uses some PNGs and/or default values for API<21. | |
The main reason is that android drawable resource definitions (prior API 21) CANNOT use theme attributes at all, so there's no way of making something like: | |
<shape android:shape="rectangle"> | |
<solid android:color="?attr/colorControlHighlight" /> | |
</shape> | |
For this, I've put this simple mockup on how to give your app better drawables that the appcompat defaults. |
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 com.dopplerlabs.hereactivelistening.hacks; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.Matrix; | |
import android.graphics.RectF; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; |
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
#!/bin/sh | |
# Copy templates to Android Studio in default location | |
TMP_PATH=`pwd` | |
TEMPLATES_PATH="/Applications/Android Studio.app/Contents/plugins/android/lib/templates/other" | |
DIRS=`find $TMP_PATH -type d -maxdepth 1 -not -name '.*' -not -path $TMP_PATH` | |
for f in $DIRS |
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
/* Attributes | |
<declare-styleable name="DateTimePickerView"> | |
<attr name="timeHourOfDay" format="integer"/> | |
<attr name="timeMinute" format="integer"/> | |
<attr name="timeFormat" format="string"/> | |
<attr name="timeType" format="enum"> | |
<enum name="time" value="0"/> | |
<enum name="date" value="1"/> | |
</attr> |
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 kotterknife | |
import android.app.Activity | |
import android.app.Dialog | |
import android.app.DialogFragment | |
import android.app.Fragment | |
import android.arch.lifecycle.Lifecycle | |
import android.arch.lifecycle.LifecycleObserver | |
import android.arch.lifecycle.LifecycleOwner | |
import android.arch.lifecycle.OnLifecycleEvent |
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
// https://akarnokd.blogspot.ru/2017/09/rxjava-vs-kotlin-coroutines-quick-look.html | |
import kotlinx.coroutines.experimental.* | |
suspend fun f1(i: Int): Int { | |
Thread.sleep(if (i != 2) 2000L else 200L) | |
return 1 | |
} | |
suspend fun f2(i: Int): Int { | |
Thread.sleep(if (i != 2) 2000L else 200L) |
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 TicketsPresenter extends BasePresenter<TicketsView, TicketsModel> { | |
private final DisplayErrorUsecase displayErrorUsecase; | |
private final LoadTicketsPageUsecase loadTicketsPageUsecase; | |
private final ArchiveTicketUsecase archiveTicketUsecase; | |
private final RenewTicketUsecase renewTicketUsecase; | |
private final DeleteTicketUsecase deleteTicketUsecase; | |
private final DeleteAllArchivedTicketsUsecase deleteAllArchivedTicketsUsecase; |
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 com.your.package | |
import android.app.Dialog | |
import android.os.Bundle | |
import com.your.package.R | |
import com.google.android.material.bottomsheet.BottomSheetDialog | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
/** | |
* BottomSheetDialog fragment that uses a custom |
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 com.pixite.pigment.testing | |
import android.app.Activity | |
import android.app.Application | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Bundle | |
import androidx.fragment.app.Fragment | |
import androidx.fragment.app.FragmentActivity | |
import androidx.fragment.app.FragmentManager |
OlderNewer