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
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Typeface; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
import android.support.v4.content.ContextCompat; | |
import android.util.AttributeSet; |
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
{ | |
"data":{ | |
"notif_title":"title", | |
"notif_body":"body", | |
"app_url":"http://google.com/app.apk", | |
"product_id":"0", //for erlear version to donot force close after get push | |
"request_type":"update", | |
"request_value":"8" |
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 ir.beigirad.peyk60.ui; | |
import android.app.ProgressDialog; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.graphics.Point; | |
import android.location.Address; | |
import android.location.Geocoder; |
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
Marker setMarker(LatLng location, MarkerType type) { | |
BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(type.equals(MarkerType.Start) ? R.drawable.marker_start : R.drawable.marker_end); | |
Marker marker = mGoogleMap | |
.addMarker( | |
new MarkerOptions() | |
.position(location) | |
// .icon(BitmapDescriptorFactory.defaultMarker(type.equals(MarkerType.Start)?BitmapDescriptorFactory.HUE_AZURE:BitmapDescriptorFactory.HUE_GREEN))); | |
.icon(icon)); |
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 setupViewPger() { | |
SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager(), slider_urls); | |
mViewPager = (ViewPager) findViewById(R.id.view_pager); | |
mViewPager.setAdapter(mSectionsPagerAdapter); | |
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); | |
tabLayout.setSelectedTabIndicatorHeight(10); | |
tabLayout.setupWithViewPager(mViewPager); | |
} |
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 ir.beigirad.zeroapplication.widget; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.StaggeredGridLayoutManager; | |
/** | |
* Created by farhad-mbp on 8/28/17. |
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
android { | |
... | |
if (project.hasProperty("myproject.properties") && new File(project.property("myproject.properties")).exists()) { | |
Properties props = new Properties() | |
props.load(new FileInputStream(file(project.property("myproject.properties")))) | |
signingConfigs { | |
release { | |
storeFile file(props['storeFile']) |
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
@Multipart | |
@POST("/endpoint") | |
Call<Post> sendPost(@Part("caption") String caption, @Part MultipartBody.Part image); |
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
@RequiresApi(Build.VERSION_CODES.M) | |
class FingerprintHelper(var context: Context, var fingerInterface: FingerInterface?) : FingerprintManager.AuthenticationCallback() { | |
private var keyguardManager: KeyguardManager = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager | |
private var fingerManager: FingerprintManager = context.getSystemService(Context.FINGERPRINT_SERVICE) as FingerprintManager | |
private var cancellationSignal: CancellationSignal = CancellationSignal() | |
private var keyStore: KeyStore? = null | |
private var keyGenerator: KeyGenerator? = null | |
private var cipher: Cipher? = null |
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 copyDataBase() { | |
try { | |
String asstFileDir = "databases/" + DB_NAME; | |
Log.i(TAG, "Copy DB from " + asstFileDir); | |
InputStream is = context.getAssets().open(asstFileDir); | |
Log.i(TAG, "available : " + is.available()); | |
File folder = new File(NEW_DB_PATH); |
OlderNewer