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
namespace Sample | |
{ | |
using Android.App; | |
using Android.OS; | |
using Android.Widget; | |
using Mikepenz.MaterialDrawer; | |
using Android.Support.V7.App; | |
[Activity(MainLauncher = true, Label = "TestCustomDrawerViewActivity", Theme = "@style/MaterialDrawerTheme.Light.DarkToolbar.TranslucentStatus")] | |
public class TestCustomDrawerViewActivity : AppCompatActivity |
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
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.AttributeSet; | |
import android.view.View; | |
public class EmptyRecyclerView extends RecyclerView { | |
@Nullable |
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 static Intent createIntent(Context context, int contentId, Class<?> referrer) { | |
Intent intent = new Intent(context, ContentDetailsActivity.class); | |
intent.putExtra(CONTENT_ID, contentId); | |
Referrers.putReferrer(intent, referrer); | |
return intent; | |
} |
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
// Check whether back stack exists. | |
if (Referrers.hasReferrer(getIntent())) { | |
// If the current back stack exists just navigate to parent activity. | |
Class parentActivityClass = Referrers.getReferrer(getIntent()); | |
Intent intent = new Intent(this, parentActivityClass).setFlags(FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP); | |
this.startActivity(intent); | |
} else { | |
// If ItemDetailsActivity was open for example from the notification then create back stack manually. | |
Intent collectionsIntent = ContentCollectionActivity.createIntent(this, null); |
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
boolean isFavourite = false; | |
for (MediaItem item : mediaItemList) { | |
if (item.getId().equalsIgnoreCase(currentItem.getId())) { | |
isFavourite = true; | |
} | |
} |
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 List<Pair<Character,MediaItem>> convert(List<Character> characters) { | |
List<Pair<Character,MediaItem>> downloads = new ArrayList<>(); | |
for (Character character : characters) { | |
if (character.getItems() == null) { | |
continue; | |
} | |
for (MediaItem item : character.getItems()) { | |
downloads.add(new Pair<>(character, item)); | |
} |
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
boolean find(List<MediaItem> data) { | |
return Stream.stream(data) | |
.any(new solid.functions.Func1<MediaItem, Boolean>() { | |
@Override | |
public Boolean call(MediaItem item) { | |
return item.isActive; | |
} | |
}); | |
} |
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 int findFirstValue(List<MediaItem> items) { | |
return Stream.stream(items) | |
.filter(new Func1<MediaItem, Boolean>() { | |
@Override | |
public Boolean call(MediaItem item) { | |
return item.isActive; | |
} | |
}) | |
.map(new Func1<MediaItem, Pair<Integer, String>>() { | |
@Override |
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
## convert HTML POST data or HTTP GET query string to JSON | |
## get the raw post data from the AWS built-in variable and give it a nicer name | |
#if ($context.httpMethod == "POST") | |
#set($rawAPIData = $input.path('$')) | |
## escape any quotes | |
#set($rawAPIData = $rawAPIData.replace('"', '\"')) | |
#elseif ($context.httpMethod == "GET") | |
#set($rawAPIData = $input.params().querystring) | |
#set($rawAPIData = $rawAPIData.toString()) |
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
#!/bin/bash | |
if [[ -z "${CI_PULL_REQUEST}" ]]; then | |
echo "---> Making build outside of Pull Request (building single commit or branch)" | |
./gradlew gnagCheck | |
else | |
echo "---> Making build for Pull Request" | |
# In the env variable CI_PULL_REQUEST CircleCI provides the URL of the PR (like https://github.com/amatkivskiy/sample/pull/3) | |
# But for the Gnag task we need PR number (simply 3) | |
# ${CI_PULL_REQUEST##*/} means that we simply get '3' from the URL provided in CI_PULL_REQUEST/ |
OlderNewer