Skip to content

Instantly share code, notes, and snippets.


Paul Trinko PollyGlot

View GitHub Profile
PollyGlot / BottomNavigation.kt
Created Jan 3, 2020
A method to control navigation graphs in bottomNavigationBar
View BottomNavigation.kt
* Called on first creation and when restoring state.
private fun setupBottomNavigationBar(recreated: Boolean) {
val bottomNavigationView = findViewById<BottomNavigationView>(
val navGraphIds = listOf(TABS.BROWSE.navId, TABS.SEARCH.navId, TABS.FEED.navId, TABS.PROFILE.navId, TABS.PLUS.navId)
// Setup the bottom navigation view with a list of navigation graphs
val controller = bottomNavigationView.setupWithNavController(
PollyGlot / NavigateToCommentsFragment.kt
Created Jan 3, 2020
A method to navigate to comments fragment from different types of posts in the feed adapter
View NavigateToCommentsFragment.kt
private fun navigateToCommentsFragment(holder: ViewHolder) {
val timeLineObject = timelineList[holder.adapterPosition]
holder.itemView.findNavController().navigate(, Bundle().apply {
putInt(CommentsFragment.EXTRA_COMMENTS, timeLineObject.comments)
putInt(CommentsFragment.EXTRA_LIKES_COUNT, timeLineObject.likes)
putBoolean(CommentsFragment.EXTRA_LIKED, timeLineObject.hasLiked)
putInt(CommentsFragment.EXTRA_POSITION, holder.adapterPosition)
putString(CommentsFragment.EXTRA_PROFILE_IMAGE, timeLineObject.user.avatarUrl)
PollyGlot / FilterActivity.kt
Created Jan 3, 2020
A filter functionality I was responsible for to filter videos / playlists in search results of a Kinomap application
View FilterActivity.kt
package com.kinomap.trainingapps.helper
import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.Log
import android.view.Menu
PollyGlot / Extensions.kt
Created Jan 3, 2020
A list of extension functions I created for a Kinomap project
View Extensions.kt
package com.kinomap.kinomapcommon.util
import android.content.SharedPreferences
import android.content.res.Resources
import android.os.Build
import android.view.View
import androidx.annotation.DrawableRes
import androidx.annotation.PluralsRes
PollyGlot / VideosListAdapter.kt
Created Jan 3, 2020
RecyclerView adapter to show several recyclerviews with different orientations and types of headers
View VideosListAdapter.kt
package com.kinomap.trainingapps.helper
import android.content.Intent
import android.os.Bundle
import android.preference.PreferenceManager
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
View build.gradle
apply plugin: ''
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.compileSdkVersion
def versionPropsFile = file('')
def value = 0
Properties versionProps = new Properties()
private void userLogin(String email, String password) {
mFirebaseAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
public void onComplete(@NonNull Task<AuthResult> task) {
Log.d(TAG, "signInWithEmail:onComplete:" + task.isSuccessful());
if (!task.isSuccessful()) {
Log.w(TAG, "signInWithEmail", task.getException());
You can’t perform that action at this time.