View android-notification-listener-get-stacked-notification-text
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
String getNotificationText(Bundle extras) { | |
CharSequence[] lines = extras.getCharSequenceArray(Notification.EXTRA_TEXT_LINES); | |
if(lines != null && lines.length > 0) { | |
StringBuilder sb = new StringBuilder(); | |
for (CharSequence msg : lines) | |
if (!TextUtils.isEmpty(msg)) { | |
sb.append(msg.toString()); | |
sb.append('\n'); | |
} | |
return sb.toString().trim(); |
View gist:d9914c12b98446a25232aea23e4740f8
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
bottom_navigation_elevation | |
bottom_navigation_height | |
bottom_navigation_icon | |
bottom_navigation_margin_bottom | |
bottom_navigation_margin_top_active | |
bottom_navigation_margin_top_inactive | |
bottom_navigation_max_width | |
bottom_navigation_min_width | |
bottom_navigation_notification_elevation | |
bottom_navigation_notification_height |
View NetworkModule.java
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 | |
public class NetworkModule { | |
private static final String BASE_URL = "https://api.github.com/"; | |
@Provides | |
static Retrofit provideRetrofit() { | |
return new Retrofit.Builder().baseUrl(BASE_URL) | |
.addCallAdapterFactory(RxJava2CallAdapterFactory.create()) | |
.addConverterFactory(GsonConverterFactory.create()) |
View django-rest-framework.py
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
jwt_decode_handler = api_settings.JWT_DECODE_HANDLER | |
jwt_get_username_from_payload = api_settings.JWT_PAYLOAD_GET_USERNAME_HANDLER | |
token = '' | |
try: | |
payload = jwt_decode_handler(token) | |
except jwt.ExpiredSignature: | |
return | |
except jwt.DecodeError: |
View gist:8115672b83abcc4b2c3bc7422c03abe6
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
sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT |
View BaseApplication.java
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 BaseApplication extends DaggerApplication { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
} | |
@Override | |
protected AndroidInjector<? extends DaggerApplication> applicationInjector() { | |
ApplicationComponent component = DaggerApplicationComponent.builder().application(this).build(); |
View ViewModelModule.java
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
@Singleton | |
@Module | |
abstract class ViewModelModule { | |
@Binds | |
@IntoMap | |
@ViewModelKey(ListViewModel.class) | |
abstract ViewModel bindListViewModel(ListViewModel listViewModel); | |
@Binds |
View MainFragmentBindingModule.java
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 | |
public abstract class MainFragmentBindingModule { | |
@ContributesAndroidInjector | |
abstract ListFragment provideListFragment(); | |
@ContributesAndroidInjector | |
abstract DetailsFragment provideDetailsFragment(); | |
} |
View ActivityBindingModule.java
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 | |
public abstract class ActivityBindingModule { | |
@ContributesAndroidInjector(modules = {MainFragmentBindingModule.class}) | |
abstract MainActivity bindMainActivity(); | |
} |
View BaseFragment.java
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 abstract class BaseFragment extends DaggerFragment { | |
private Unbinder unbinder; | |
private AppCompatActivity activity; | |
@LayoutRes | |
protected abstract int layoutRes(); | |
@Override | |
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { |
OlderNewer