Skip to content

Instantly share code, notes, and snippets.

İbrahim Süren ibrahimsn98

Block or report user

Report or block ibrahimsn98

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ibrahimsn98
ibrahimsn98 / android-notification-listener-get-stacked-notification-text
Created Feb 15, 2018
Android notification listener get stacked notification text
View android-notification-listener-get-stacked-notification-text
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();
@ibrahimsn98
ibrahimsn98 / gist:d9914c12b98446a25232aea23e4740f8
Created Jun 9, 2018
Android Bottom Navigation View Dimens
View gist:d9914c12b98446a25232aea23e4740f8
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
@ibrahimsn98
ibrahimsn98 / AdmobConsentSimple
Created Jun 18, 2018 — forked from ameerhamza6733/AdmobConsentSimple
Simple for Consent sdk android admob
View AdmobConsentSimple
/*https://www.youtube.com/watch?v=_JOapnq8hrs&t=852s
video tutorial for consent sdk android
*/
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
@ibrahimsn98
ibrahimsn98 / NetworkModule.java
Created Jul 6, 2018
android-mvvm-with-dagger-2-module-network
View NetworkModule.java
@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())
@ibrahimsn98
ibrahimsn98 / django-rest-framework.py
Created Aug 6, 2018
django-rest-framework-jwt-get-user-from-token
View django-rest-framework.py
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
sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
@ibrahimsn98
ibrahimsn98 / BaseApplication.java
Last active Aug 19, 2018
android-mvvm-with-dagger-2
View BaseApplication.java
public class BaseApplication extends DaggerApplication {
@Override
public void onCreate() {
super.onCreate();
}
@Override
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
ApplicationComponent component = DaggerApplicationComponent.builder().application(this).build();
@ibrahimsn98
ibrahimsn98 / ViewModelModule.java
Last active Aug 19, 2018
android-mvvm-with-dagger-2
View ViewModelModule.java
@Singleton
@Module
abstract class ViewModelModule {
@Binds
@IntoMap
@ViewModelKey(ListViewModel.class)
abstract ViewModel bindListViewModel(ListViewModel listViewModel);
@Binds
@ibrahimsn98
ibrahimsn98 / MainFragmentBindingModule.java
Last active Aug 19, 2018
android-mvvm-with-dagger-2
View MainFragmentBindingModule.java
@Module
public abstract class MainFragmentBindingModule {
@ContributesAndroidInjector
abstract ListFragment provideListFragment();
@ContributesAndroidInjector
abstract DetailsFragment provideDetailsFragment();
}
@ibrahimsn98
ibrahimsn98 / ActivityBindingModule.java
Last active Aug 19, 2018
android-mvvm-with-dagger-2
View ActivityBindingModule.java
@Module
public abstract class ActivityBindingModule {
@ContributesAndroidInjector(modules = {MainFragmentBindingModule.class})
abstract MainActivity bindMainActivity();
}
You can’t perform that action at this time.