Skip to content

Instantly share code, notes, and snippets.

View dazza5000's full-sized avatar

dazza5000

View GitHub Profile
/**
* A custom slider composable that allows selecting a value within a given range.
*
* @param value The current value of the slider.
* @param onValueChange The callback invoked when the value of the slider changes.
* @param modifier The modifier to be applied to the slider.
* @param valueRange The range of values the slider can represent.
* @param gap The spacing between indicators on the slider.
* @param showIndicator Determines whether to show indicators on the slider.
* @param showLabel Determines whether to show a label above the slider.
@dseerapu
dseerapu / gist:b768728b3b4ccf282c7806a3745d0347
Last active October 25, 2022 15:04
Android app inactivity timeout | Android Logout timer
public class LogOutTimerUtil {
public interface LogOutListener {
void doLogout();
}
static Timer longTimer;
static final int LOGOUT_TIME = 600000; // delay in milliseconds i.e. 5 min = 300000 ms or use timeout argument
public static synchronized void startLogoutTimer(final Context context, final LogOutListener logOutListener) {
import android.app.Presentation;
import android.content.Context;
import android.location.Location;
import android.provider.CalendarContract;
import android.widget.Toast;
import java.util.ArrayList;
/**
* Created by mgarner on 12/11/2015.
@mauimauer
mauimauer / AA-AndroidWearCrashlytics.md
Last active November 24, 2021 09:58
Forward Wear Crashed to Smartphone/Tablet for reporting via Crashlytics (or other Crash Analytics solutions)

Send uncaught Exceptions from Android Wear to Android

This is a short Gist showing how I transmit any uncaught exceptions happening in the Wearable part of my App to the connected Smartphone/Tablet. This is necessary because Android Wear devices are not directly connected to the Internet themselves.

##Wear

  • WearApp.java
  • AndroidManifest.xml
  • ErrorService.java
@gabrielemariotti
gabrielemariotti / mobile-AndroidManifest.xml
Last active September 15, 2020 11:33
Android Wear: small gist to start an Activity on the mobile handheld from the Android Wear device.
<service android:name=".ListenerServiceFromWear">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
@maurerbot
maurerbot / MeetupAuthActivity.java
Last active January 12, 2017 04:46
Created this to authenticate meetup for an android app.
import android.content.ContentValues;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
// leeloo oAuth lib https://bitbucket.org/smartproject/oauth-2.0/wiki/Home