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
VideoUploader.uploadAsyncWithProgressCallback( | |
videoContentBuilder.build(), | |
pageId, | |
object : GraphRequest.OnProgressCallback { | |
override fun onCompleted(response: GraphResponse) { | |
// {Response: responseCode: 200, graphObject: {"success":true,"video_id":"380208427529152"} | |
try { | |
val videoId = parseResponseVideoId(response.jsonObject) |
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
val accessToken : AccessToken = | |
AccessToken( | |
// String token you saved from Pages list | |
token, | |
// replace it by your applicationId | |
"com.app.packagename", | |
// ID you saved from Pages list | |
pageId, | |
// The same permissions list we used for Login flow at point 4 | |
listOf("public_profile", "pages_manage_posts"), |
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
<resources> | |
<string name="facebook_app_id">{app_id_here}</string> | |
<string name="fb_login_protocol_scheme">fb{app_id_here}</string> | |
<string name="facebook_client_token">{client_token}</string> | |
</resources> |
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
<application> | |
<activity | |
android:name="com.facebook.FacebookActivity" | |
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme.Facebook.NoActionBar" | |
tools:replace="android:theme" /> | |
<activity | |
android:name="com.facebook.CustomTabActivity" |
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
object FacebookGraphUtil { | |
@Throws(RuntimeException::class) | |
fun getFacebookPageList(accessToken: AccessToken, doOnSuccess: (List<FacebookPage>) -> Unit) { | |
GraphRequest.newGraphPathRequest( | |
accessToken, | |
"/me/accounts" | |
) { response: GraphResponse -> | |
parsePageListJson(response.jsonObject) |
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
<resources xmlns:tools="http://schemas.android.com/tools"> | |
<style name="AppTheme.Material.NoActionBar" parent="Theme.Material3.Dark.NoActionBar"> | |
<item name="android:windowBackground">@color/colorWindowGreyBackground</item> | |
<!-- Primary brand color. --> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorOnPrimary">@color/colorWindowBackground</item> | |
<item name="colorPrimaryContainer">@color/colorAccent</item> | |
<item name="colorOnPrimaryContainer">@color/colorPrimaryDark</item> |
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
#! /bin/sh | |
# | |
# Script to build AAB release on local machine. | |
# | |
# Before continue please make sure | |
# you have the following variables in the file keystore.properties: | |
# | |
# KEYPWD - it's keyPassword | |
# KSTOREPWD - it's storePassword | |
# KEYSTORE_ALIAS - alias |
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
//How to use this observer - see 02.Fragment.kt below | |
class RuntimePermissionObserver( | |
private val activity: FragmentActivity | |
) : LifecycleObserver { | |
private var onGranted: () -> Unit = {} | |
private var onDenied: () -> Unit = {} | |
private var onShouldShowRationale: () -> Unit = {} |
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
#! /bin/sh | |
# | |
# Before continue please make sure | |
# you have the following variables in the file keystore.properties: | |
# | |
# KEYPWD - it's keyPassword | |
# KSTOREPWD - it's storePassword | |
# KEYSTORE_ALIAS - alias | |
# KEYSTORE_SECRET - it's a result of command 'gpg -c --armor release.keystore' |
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
/** | |
* A custom scrollable ViewPager | |
* NOTE: it uses in a production app. | |
* <p> | |
* Created by Dmitriy V. Chernysh on 2/7/19. | |
* <p> | |
* https://instagr.am/mobiledevpro | |
* #MobileDevPro | |
*/ |
NewerOlder