Skip to content

Instantly share code, notes, and snippets.

View Rohyme's full-sized avatar
👨‍💻
Code. Tea. Repeat. ☕️💻🔁

Rohyme

👨‍💻
Code. Tea. Repeat. ☕️💻🔁
  • 4Sale International Co.
  • Cairo , Egypt
  • X @r0hyme
View GitHub Profile
@Rohyme
Rohyme / IndefinitePagerIndicator.kt
Created May 11, 2023 08:51 — forked from kliphouse/IndefinitePagerIndicator.kt
A horizontal pager indicator for compose that uses [PagerState](https://google.github.io/accompanist/pager/#pagerstate) (based on [IndefinitePagerIndicator](https://github.com/wching/Android-Indefinite-Pager-Indicator)
package com.rbrooks.indefinitepagerindicator
import android.view.animation.DecelerateInterpolator
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.ContentAlpha
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
@Rohyme
Rohyme / IndefinitePagerIndicator.kt
Created May 11, 2023 08:51 — forked from kliphouse/IndefinitePagerIndicator.kt
A horizontal pager indicator for compose that uses [PagerState](https://google.github.io/accompanist/pager/#pagerstate) (based on [IndefinitePagerIndicator](https://github.com/wching/Android-Indefinite-Pager-Indicator)
package com.rbrooks.indefinitepagerindicator
import android.view.animation.DecelerateInterpolator
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.ContentAlpha
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
@Rohyme
Rohyme / CustomMapItem.kt
Last active June 5, 2021 16:52
Using Map fragment in Recycler view using fastadapter
package com.example.fastadaptertest
import android.view.View
import com.google.android.gms.maps.GoogleMap
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.items.AbstractItem
/**
*
* @author Rohyme
@Rohyme
Rohyme / LocationProvider.kt
Last active March 31, 2019 12:02
Location provider lifeCycle
package com.rohyme.mysideapplication.screens.getMyLocationTesting
import android.annotation.SuppressLint
import android.content.Context
import android.content.IntentSender
import android.location.Location
import android.os.Bundle
import android.os.Looper
import android.util.Log
import android.widget.Toast
@Rohyme
Rohyme / FusedLocationFragment.kt
Last active March 27, 2019 12:21
get current location using google fused location and permission dispatcher
package com.rohyme.mysideapplication.screens.getMyLocationTesting
import android.Manifest
import android.annotation.SuppressLint
import android.app.AlertDialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.location.LocationManager
import android.os.Bundle
@Rohyme
Rohyme / ListActivity.kt
Last active October 2, 2018 01:55
Horizontal Grid ListView
package com.example.rohyme.testingapp
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v7.widget.GridLayoutManager
import kotlinx.android.synthetic.main.activity_main.*
class ListActivity : AppCompatActivity() {
public class WebViewInJava extends AppCompatActivity{
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
initWebView("http://riverback-testing.westeurope.cloudapp.azure.com/river_back_backend/public/Rating?QR=abcd123");
}
void initWebView(String url){
@Rohyme
Rohyme / WebViewActivity
Created July 25, 2018 12:01
web view with java script ability
class WebViewActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_web_view)
initWebView("http://riverback-testing.westeurope.cloudapp.azure.com/river_back_backend/public/Rating?QR=abcd123")
}
fun initWebView(url :String){
@Rohyme
Rohyme / BaseActivity.java
Last active July 3, 2018 09:40
Change Locality Android (Fixing locality changes problems after android oreo) Java
public class BaseActivity extends AppCompatActivity() {
@override
public void attachBaseContext(Context newBase){
String langCode = "en";
ContextWrapper context = ContextWrapper.Wrap(newBase , langCode);
LocalizationUtils.changeLang(context,langCode)
super.attachBaseContext(context)
}