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 SplashActivity extends Activity { | |
private static long SLEEP_TIME = 3; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(layout.activity_splash); | |
// Start timer and launch main activity |
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
// This example uses decor view, but you can use any visible view. | |
View decorView = getActivity().getWindow().getDecorView(); | |
int uiOptions = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; | |
decorView.setSystemUiVisibility(uiOptions); |
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 static int scheduleFirstAt(int aDay, int hours, int mins) { | |
int jobID = -1; | |
long startMs = 0L, endMs = 0L; | |
int MARGIN_TIME = 30; | |
// Current Day | |
DateTime currentDay = new DateTime(); |
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
fun makeUserOnline(user: UserModel) | |
{ | |
// Firestore | |
var query = FirebaseFirestore.getInstance().collection("users").document(user.userId ?: "") | |
user.apply { | |
online = true | |
last_active = 0 | |
} | |
query.set(user) | |
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
FirebaseDatabase.getInstance() | |
.getReference("some/random/key") | |
.onDisconnect() // Setting up Disconnect hook | |
.setValue("Update any kind of values you want 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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
const firestore = functions.firestore; | |
exports.onUserStatusChange = functions.database | |
.ref('/status/{userId}') | |
.onUpdate(event => { | |
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
fun makeUserOnline(user: UserModel) | |
{ | |
// Adding on disconnect hook | |
FirebaseDatabase.getInstance().getReference("/status/" + user.userId) | |
.onDisconnect() // Set up the disconnect hook | |
.setValue("offline"); | |
} |
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
package com.pascalwelsch.extensions | |
import android.app.Activity | |
import android.content.Context | |
import android.content.Intent | |
import android.os.Build | |
import android.os.Bundle | |
/** | |
* Extensions for simpler launching of Activities |
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
package com.wajahatkarim3.chipsdemo; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.widget.MultiAutoCompleteTextView; | |
import com.android.ex.chips.RecipientEditTextView; | |
import com.tokenautocomplete.TokenCompleteTextView; | |
public class MainActivity extends AppCompatActivity { |
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 java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import timber.log.Timber; | |
public class LinkingDebugTree extends Timber.DebugTree { | |
private static final int CALL_STACK_INDEX = 4; | |
private static final Pattern ANONYMOUS_CLASS = Pattern.compile("(\\$\\d+)+$"); |
OlderNewer