Eclipse has an official guide now!
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 abstract class ContentLoadingFrameLayout extends FrameLayout { | |
private static final int MIN_SHOW_TIME = 200; // ms | |
private static final int MIN_DELAY = 200; // ms | |
private ProgressBar mProgressBar; | |
private View mContent; | |
private long mStartTime = -1; | |
private boolean mPostedHide = false; | |
private boolean mPostedShow = false; |
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
/* | |
* Copyright (C) 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<RelativeLayout android:id="@+id/topLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView android:id="@+id/backgroundImage" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
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
return new GsonBuilder() | |
.registerTypeAdapter(SimpleArrayMapJsonSerializer.TYPE, new SimpleArrayMapJsonSerializer()) | |
.create(); |
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
private ArrayAdapter<String> getEmailAddressAdapter(Context context) { | |
Account[] accounts = AccountManager.get(context).getAccountsByType("com.google"); | |
String[] addresses = new String[accounts.length]; | |
for (int i = 0; i < accounts.length; i++) { | |
addresses[i] = accounts[i].name; | |
} | |
return new ArrayAdapter<String>(context, android.R.layout.simple_dropdown_item_1line, addresses); | |
} |
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
private static final String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$"; | |
private static final Pattern EMAIL_PATTERN = Pattern.compile(EMAIL_REGEX); | |
private ArrayAdapter<String> getEmailAddressAdapter(Context context) { | |
Account[] accounts = AccountManager.get(context).getAccounts(); | |
HashSet<String> emailSet = new HashSet<String>(); | |
for (int i = 0; i < accounts.length; i++) { | |
if (isEmailAddress(accounts[i].name)) { | |
emailSet.add(accounts[i].name); | |
} |
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 javax.annotation.Nonnull; | |
import android.content.Context; | |
import android.content.res.Configuration; | |
import android.os.Build; | |
/** | |
* <p>Keeper of the {@linkplain Build#VERSION_CODES Android version gates}, used to guarantee non shall pass, | |
* unless they are worthy.</p> | |
* @author Dandre Allison |
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 JacksonConverter<T> implements FileObjectQueue.Converter<T> { | |
private final ObjectMapper mMapper; | |
private final Class<T> mType; | |
public JacksonConverter(ObjectMapper mapper, Class<T> type) { | |
this.mType = type; | |
this.mMapper = mapper; | |
} |
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
/*** | |
Copyright (c) 2013 CommonsWare, LLC | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
use this file except in compliance with the License. You may obtain a copy | |
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required | |
by applicable law or agreed to in writing, software distributed under the | |
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
OF ANY KIND, either express or implied. See the License for the specific | |
language governing permissions and limitations under the License. | |
*/ |
OlderNewer