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(); |
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 |
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()) |
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: |
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 |
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(); |
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 |
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(); | |
} |
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(); | |
} |
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