This file contains hidden or 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.util.AttributeSet; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.view.View; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.graphics.Canvas; |
This file contains hidden or 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
| final InAppSub mInAppSub = new InAppSub(this); | |
| mInAppSub.bindServiceConn(); | |
| Bundle ownedItems = mInAppSub.getPurchaseIntent(); | |
| if (ownedItems != null) { | |
| int response = ownedItems.getInt("RESPONSE_CODE"); | |
| if (response != 0) { |
This file contains hidden or 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 MainActivity extends AppCompatActivity { | |
| private AnimatorSet mSetRightOut; | |
| private AnimatorSet mSetLeftIn; | |
| private boolean mIsBackVisible = false; | |
| private View mCardFrontLayout; | |
| private View mCardBackLayout; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { |
This file contains hidden or 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
| def appVersionName = "1.0.0" | |
| def appVersionCode = 12 | |
| android { | |
| //... | |
| defaultConfig { | |
| //.. | |
| // Add version and build number to apk name | |
| setProperty("archivesBaseName", "app-${appVersionName}-${appVersionCode}") | |
| } |
This file contains hidden or 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
| interface UploadService { | |
| @Headers("Content-Type: image/jpeg") | |
| @POST("/files") | |
| fun uploadFile(@Body file: TypedFile): Observable<UploadedFile> | |
| } |
This file contains hidden or 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
| 1 .Recyclerview Item Decoration. | |
| https://www.bignerdranch.com/blog/a-view-divided-adding-dividers-to-your-recyclerview-with-itemdecoration/ | |
| 2. android-data-sync- sync Adapter | |
| http://chariotsolutions.com/blog/post/android-data-sync/ | |
| https://software.intel.com/en-us/android/articles/handling-offline-capability-and-data-sync-in-an-android-app-part-2 | |
| http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter |
This file contains hidden or 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
| <resources> | |
| <style name="AppTheme" parent="AppBaseTheme"> | |
| <!-- Extends the base theme below --> | |
| </style> | |
| <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | |
| <item name="android:actionBarStyle">@style/MyActionBar</item> | |
| <item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item> |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright 2016 Google Inc. | |
| 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 |
This file contains hidden or 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
| // omissis | |
| @Override | |
| public void onBindViewHolder(final CustomViewHolder holder, final int position) { | |
| holder.mSwitch.setOnCheckedChangeListener( | |
| new CompoundButton.OnCheckedChangeListener() { | |
| @Override | |
| public void onCheckedChanged(CompoundButton buttonView, final boolean isChecked) { | |
| // TODO: handle your switch toggling logic here | |
| } |
This file contains hidden or 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.applicationVariants.all { variant -> | |
| def applicationId = variant.applicationId | |
| def adb = androidadbExe. as String | |
| def variantName = variant.name.capitalize() | |
| def grantPermissionTask = task.create("create${variantName}Permissions") << { | |
| "${adb} devices".execute().text.eachLine { | |
| if(it.endsWith("device")){ | |
| def device = it.split()[0] | |
| println "Granting permissions on devices ${device}" | |
| "${adb} -s ${devices} shell pm grant ${applicationId} android.permission.ACCESS_FINE_LOCATION".execute() |