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
require 'net/http' | |
require 'uri' | |
require 'json' | |
uri = URI.parse('https://fcm.googleapis.com/fcm/send') | |
http_proxy = ENV['HTTP_PROXY'] | |
https_proxy = ENV['HTTPS_PROXY'] | |
proxy_host = nil |
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
def send_notification | |
fcm = FCM.new(ENV['FIREBASE_SERVER_KEY'], { mutable_content: true, content_available: true, priority: 'high' }) | |
registration_ids = [event_slot.physiotherapist.firebase_token] | |
date = I18n.l(event_slot.appointment_time, format: :short) | |
payload = { data: { title: 'Você tem um novo agendamento', body: "Confirme sua disponibilidade para atender na #{franchise.nome}, #{date}" }, mutable_content: true, content_available: true, priority: 'high' } | |
if (event_slot.physiotherapist.platform == 'ios') | |
payload[:notification] = payload[:data] | |
end |
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 br.com.wozapp.networkstatistics | |
import android.os.StrictMode | |
import br.com.wozapp.data.model.AppStatistics | |
import br.com.wozapp.data.model.TotalStatistics | |
class NetworkStatistics private constructor() { | |
companion object { |
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.text.Editable | |
import android.text.TextWatcher | |
import android.text.method.DigitsKeyListener | |
import android.widget.EditText | |
import java.lang.ref.WeakReference | |
import java.math.BigDecimal | |
import java.text.NumberFormat | |
import java.util.* |
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.Context; | |
import android.content.res.Configuration; | |
import android.view.OrientationEventListener; | |
import android.view.Surface; | |
import android.view.WindowManager; | |
import java.util.concurrent.locks.ReentrantLock; | |
public abstract class SimpleOrientationListener extends OrientationEventListener { |
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.Context | |
import android.net.ConnectivityManager | |
import com.bumptech.glide.GlideBuilder | |
import com.bumptech.glide.Registry | |
import com.bumptech.glide.annotation.GlideModule | |
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader | |
import com.bumptech.glide.load.model.GlideUrl | |
import com.bumptech.glide.module.AppGlideModule | |
import okhttp3.OkHttpClient | |
import java.io.InputStream |
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.Context | |
import android.support.v4.widget.SwipeRefreshLayout | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
/*** | |
* Set the enabled property only when an touch up or touch cancel is detected | |
*/ | |
class CustomSwipeRefreshLayout : SwipeRefreshLayout { |
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
mServiceIntent = new Intent(getActivity(), RSSPullService.class); | |
mServiceIntent.setData(Uri.parse(dataUrl)); | |
// Inicia o IntentService | |
startService(mServiceIntent); |
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 HeavyWorkTask extends AsyncTask<String, Void, String> { | |
TextView mStatusTextView; | |
public HeavyWorkTask(TextView statusTextView) { | |
mStatusTextView = statusTextView; | |
} | |
@Override | |
protected String doInBackground(String... urls) { | |
return doHeavyWork(urls[0]); |
NewerOlder