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
| static String formatBytes(int bytes, int decimals) { | |
| if (bytes <= 0) return "0 B"; | |
| const suffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; | |
| var i = (log(bytes) / log(1024)).floor(); | |
| return ((bytes / pow(1024, i)).toStringAsFixed(decimals)) + | |
| ' ' + | |
| suffixes[i]; | |
| } |
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
| class FCMService2 : FirebaseMessagingService() { | |
| private var pendingIntent: PendingIntent? = null | |
| override fun onMessageReceived(remoteMessage: RemoteMessage?) { | |
| Log.e("get_type_data", remoteMessage!!.data.toString()) | |
| createNotification(remoteMessage.data) | |
| } | |
| private fun createNotification(messageBody: Map<String, String>) { |
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 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(new MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return new MaterialApp( |
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 android.content.Intent; | |
| import android.os.Bundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.view.View; | |
| import android.widget.ArrayAdapter; | |
| import android.widget.Button; | |
| import android.widget.ListView; | |
| public class TransitionThemeActivity extends AppCompatActivity implements View.OnClickListener { |
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.collectiveidea.example; | |
| import android.content.Intent; | |
| import android.support.test.espresso.intent.Intents; | |
| import android.support.test.rule.ActivityTestRule; | |
| import android.support.test.runner.AndroidJUnit4; | |
| import com.collectiveidea.example.ui.LoginActivity; | |
| import com.collectiveidea.example.ui.MainActivity; | |
| import com.collectiveidea.example.util.AccountUtility; |
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
| private class LongRunningGetIO extends AsyncTask <Void, Void, String>{ | |
| protected String getASCIIContentFromEntity(HttpEntity entity) throws IllegalStateException, IOException{ | |
| InputStream in = entity.getContent(); | |
| StringBuffer out = new StringBuffer(); | |
| int n = 1; | |
| while (n>0) { | |
| byte[] b = new byte[4096]; | |
| n = in.read(b); | |
| if (n>0){ |