Skip to content

Instantly share code, notes, and snippets.

Sudhanshu sud007

Block or report user

Report or block sud007

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
View MyContextWrapper.java
public class MyContextWrapper extends ContextWrapper {
public MyContextWrapper(Context base) {
super(base);
}
@SuppressWarnings("deprecation")
public static ContextWrapper wrap(Context context, String language) {
Configuration config = context.getResources().getConfiguration();
Locale sysLocale = null;
View gist:945a7bf8b07bdc0e30261f5805ad540a
PhoneStateListener phoneListener;
private void setupSignalStrength() {
final TelephonyManager manager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
phoneListener = new PhoneStateListener() {
@Override
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
if (manager.getNetworkOperator().equals("")) {
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// See https://github.com/AlstonLin/TheLearningLock/issues/54
@sud007
sud007 / YourFragment.kt
Created Feb 26, 2019 — forked from rylexr/YourFragment.kt
Android navigation bar style with animation
View YourFragment.kt
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = DataBindingUtil.inflate(inflater, R.layout.your_fragment, container, false)
binding.homeAction.setOnClickListener { select(R.id.home_action) }
binding.likesAction.setOnClickListener { select(R.id.likes_action) }
binding.searchAction.setOnClickListener { select(R.id.search_action) }
binding.profileAction.setOnClickListener { select(R.id.profile_action) }
return binding.root
}
fun select(id: Int) {
View SALT
nj3roinck9j w0e9fnki0pnoin 5M6viskg5NmY s-0nwniefp9nn
You can’t perform that action at this time.