This file contains 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
yes you can | |
AppBarLayout appBar; | |
appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { | |
@Override | |
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { | |
if(verticalOffset > -300) { | |
collapsedAppBar.setTitleEnabled(false); | |
} | |
else { |
This file contains 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.example.android.sunshine.app.ui; | |
import android.support.test.rule.ActivityTestRule; | |
import android.support.test.runner.AndroidJUnit4; | |
import android.test.suitebuilder.annotation.LargeTest; | |
import com.example.android.sunshine.app.MainActivity; | |
import com.example.android.sunshine.app.R; | |
import org.junit.Rule; |
This file contains 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
-Xms1G | |
-Xmx8G | |
-XX:MaxPermSize=4G | |
-XX:ReservedCodeCacheSize=512m | |
-ea | |
-Dsun.io.useCanonCaches=false | |
-Djava.net.preferIPv4Stack=true | |
-Djna.nosys=true | |
-Djna.boot.library.path= |
This file contains 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 ru.mobileup.grushasdk.utils; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.Network; | |
import android.net.NetworkInfo; | |
import android.net.wifi.WifiManager; | |
/** | |
* @author Vasili Chyrvon (vasili.chyrvon@gmail.com) |
This file contains 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 is retrofit response | |
Eventlist eventlist = response.body(); | |
List<Website> websites = eventlist.getWebsites(); // website is POJO class for even as per api | |
List<Website> filteredWebsite = new ArrayList<Website>(); // empty list new | |
for(Website temp:websites){ | |
if(temp.getCategory().equalsIgnoreCase(sortType.name())){ | |
filteredWebsite.add(temp); // sortType.name() is BOT or Competitive or whichever selected | |
} | |
} | |
This file contains 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 DelayAutoCompleteTextView extends AutoCompleteTextView { | |
private static final int MESSAGE_TEXT_CHANGED = 100; | |
private static final int DEFAULT_AUTOCOMPLETE_DELAY = 1000; | |
private int mAutoCompleteDelay = DEFAULT_AUTOCOMPLETE_DELAY; | |
private static class AvoidingMemoryLeakHandler extends Handler { | |
private final WeakReference<DelayAutoCompleteTextView> delayAutoCompleteTextViewWeakReference; |
This file contains 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
// Use this in your testLocationTable() method | |
// Test data we're going to insert into the DB to see if it works. | |
String testLocationSetting = "99705"; | |
String testCityName = "North Pole"; | |
double testLatitude = 64.7488; | |
double testLongitude = -147.353; |
This file contains 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
// You need to import Foundation to use NSRegularExpression, NSError and NSString | |
import Foundation | |
/// This function takes three parameters | |
/// text: a string that we search in | |
/// pattern: a reqular expression pattern to use in the search | |
/// withTemplate: the string that we use instead of the occurrances we find in text | |
/// | |
/// The method returns (text) with occurrance found using (pattern) replaced with (withTemplate) | |
func regexReplace(text:String, pattern:String, withTemplate:String) -> String { |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="config_app_name">AVélib</string> | |
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string> | |
<string name="config_com.google.android.maps.v2.api_key">XXX</string> | |
</resources> |
This file contains 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
import javafx.application.Application; | |
import javafx.collections.FXCollections; | |
import javafx.event.EventHandler; | |
import javafx.scene.Scene; | |
import javafx.scene.control.ListView; |
OlderNewer