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
package jeevuz.recyclerview; | |
import android.database.ContentObserver; | |
import android.database.Cursor; | |
import android.database.DataSetObserver; | |
import android.os.Handler; | |
import android.support.v7.widget.RecyclerView; | |
import android.widget.Filter; | |
import android.widget.FilterQueryProvider; | |
import android.widget.Filterable; |
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
private void removeRippleEffectFromCheckBox(CheckBox checkBox) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
Drawable drawable = checkBox.getBackground(); | |
if (drawable instanceof RippleDrawable) { | |
drawable = ((RippleDrawable) drawable).findDrawableByLayerId(0); | |
checkBox.setBackground(drawable); | |
} | |
} | |
} |
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
# Build files and folders | |
build/ | |
.gradle/ | |
# Local | |
local.properties | |
captures/ | |
# Idea files | |
.idea/ |
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
// Start activity for result to pick contact phone | |
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Phone.CONTENT_URI); | |
startActivityForResult(intent, PICK_CONTACT_REQUEST_CODE); | |
// In the onActivityResult | |
case PICK_CONTACT_REQUEST_CODE: | |
if (resultCode == RESULT_OK) { | |
// Get the URI that points to the selected contact | |
Uri contactDataUri = data.getData(); |
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
package com.example.utils; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.ResolveInfo; | |
import android.content.res.AssetFileDescriptor; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; |
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
package com.example; | |
import android.support.annotation.NonNull; | |
import android.text.TextUtils; | |
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; |
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
/* | |
* Copyright (C) 2016 Jeff Gilfelt. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
package ru.mobileup.grushasdk.utils; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.Network; | |
import android.net.NetworkInfo; | |
import android.net.wifi.WifiManager; | |
/** | |
* @author Vasili Chyrvon ([email protected]) |
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
/** | |
* Returns true if the device is locked or screen turned off (in case password not set) | |
*/ | |
public static boolean isDeviceLocked(Context context) { | |
boolean isLocked = false; | |
// First we check the locked state | |
KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); | |
boolean inKeyguardRestrictedInputMode = keyguardManager.inKeyguardRestrictedInputMode(); |
OlderNewer