mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
Merge pull request #285 from dlew/dlew/constants-correctness
Corrected constants w/ proper Java conventions
This commit is contained in:
commit
45ef16b82f
9 changed files with 36 additions and 36 deletions
|
|
@ -23,7 +23,7 @@ import java.util.Set;
|
||||||
public class HabiticaPurchaseVerifier extends BasePurchaseVerifier {
|
public class HabiticaPurchaseVerifier extends BasePurchaseVerifier {
|
||||||
|
|
||||||
private Set<String> purchasedOrderList = new HashSet<>();
|
private Set<String> purchasedOrderList = new HashSet<>();
|
||||||
static String PURCHASED_PRODUCTS_KEY = "PURCHASED_PRODUCTS";
|
private static final String PURCHASED_PRODUCTS_KEY = "PURCHASED_PRODUCTS";
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
|
|
||||||
public HabiticaPurchaseVerifier(Context context) {
|
public HabiticaPurchaseVerifier(Context context) {
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ import de.greenrobot.event.EventBus;
|
||||||
* Created by Negue on 20.08.2015.
|
* Created by Negue on 20.08.2015.
|
||||||
*/
|
*/
|
||||||
public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerViewAdapter.ChatRecyclerViewHolder> {
|
public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerViewAdapter.ChatRecyclerViewHolder> {
|
||||||
static final int TYPE_DANIEL = 0;
|
private static final int TYPE_DANIEL = 0;
|
||||||
static final int TYPE_NEW_MESSAGE = 1;
|
private static final int TYPE_NEW_MESSAGE = 1;
|
||||||
static final int TYPE_MESSAGE = 2;
|
private static final int TYPE_MESSAGE = 2;
|
||||||
|
|
||||||
private List<ChatMessage> messages;
|
private List<ChatMessage> messages;
|
||||||
private Context viewContext;
|
private Context viewContext;
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ public class HabitItemRecyclerViewAdapter<THabitItem extends Task>
|
||||||
Context context;
|
Context context;
|
||||||
public int dailyResetOffset;
|
public int dailyResetOffset;
|
||||||
|
|
||||||
static final int TYPE_HEADER = 0;
|
private static final int TYPE_HEADER = 0;
|
||||||
static final int TYPE_CELL = 1;
|
private static final int TYPE_CELL = 1;
|
||||||
private RecyclerView.Adapter<ViewHolder> parentAdapter;
|
private RecyclerView.Adapter<ViewHolder> parentAdapter;
|
||||||
private TagsHelper tagsHelper;
|
private TagsHelper tagsHelper;
|
||||||
private IAdditionalEntries additionalEntries;
|
private IAdditionalEntries additionalEntries;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class SkillTasksRecyclerViewAdapter extends RecyclerView.Adapter<SkillTas
|
||||||
private ObservableArrayList<Task> observableContent;
|
private ObservableArrayList<Task> observableContent;
|
||||||
SkillTasksActivity activity;
|
SkillTasksActivity activity;
|
||||||
|
|
||||||
static final int TYPE_CELL = 1;
|
private static final int TYPE_CELL = 1;
|
||||||
private RecyclerView.Adapter<ViewHolder> parentAdapter;
|
private RecyclerView.Adapter<ViewHolder> parentAdapter;
|
||||||
|
|
||||||
public SkillTasksRecyclerViewAdapter(String taskType, SkillTasksActivity activity) {
|
public SkillTasksRecyclerViewAdapter(String taskType, SkillTasksActivity activity) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import io.fabric.sdk.android.Fabric;
|
||||||
*/
|
*/
|
||||||
public class GemsPurchaseFragment extends BaseFragment {
|
public class GemsPurchaseFragment extends BaseFragment {
|
||||||
|
|
||||||
static final int GEMS_TO_ADD = 21;
|
private static final int GEMS_TO_ADD = 21;
|
||||||
|
|
||||||
private BillingRequests billingRequests;
|
private BillingRequests billingRequests;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ import retrofit.client.Response;
|
||||||
|
|
||||||
public class TasksFragment extends BaseFragment implements OnCheckedChangeListener {
|
public class TasksFragment extends BaseFragment implements OnCheckedChangeListener {
|
||||||
|
|
||||||
static final int TASK_CREATED_RESULT = 1;
|
private static final int TASK_CREATED_RESULT = 1;
|
||||||
static final int TASK_UPDATED_RESULT = 2;
|
private static final int TASK_UPDATED_RESULT = 2;
|
||||||
|
|
||||||
public ViewPager viewPager;
|
public ViewPager viewPager;
|
||||||
Drawer filterDrawer;
|
Drawer filterDrawer;
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class UserPicture {
|
public class UserPicture {
|
||||||
|
|
||||||
static Integer width = 140;
|
private static final int WIDTH = 140;
|
||||||
static Integer height = 147;
|
private static final int HEIGHT = 147;
|
||||||
static Integer compactWidth = 103;
|
private static final int COMPACT_WIDTH = 103;
|
||||||
static Integer compactHeight = 90;
|
private static final int COMPACT_HEIGHT = 90;
|
||||||
|
|
||||||
private HabitRPGUser user;
|
private HabitRPGUser user;
|
||||||
private ImageView imageView;
|
private ImageView imageView;
|
||||||
|
|
@ -63,7 +63,7 @@ public class UserPicture {
|
||||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||||
o.inScaled = false;
|
o.inScaled = false;
|
||||||
|
|
||||||
Bitmap res = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
Bitmap res = Bitmap.createBitmap(WIDTH, HEIGHT, Bitmap.Config.ARGB_8888);
|
||||||
Canvas myCanvas = new Canvas(res);
|
Canvas myCanvas = new Canvas(res);
|
||||||
Integer layerNumber = 0;
|
Integer layerNumber = 0;
|
||||||
for (Object layer : this.layers) {
|
for (Object layer : this.layers) {
|
||||||
|
|
@ -74,7 +74,7 @@ public class UserPicture {
|
||||||
layerNumber++;
|
layerNumber++;
|
||||||
}
|
}
|
||||||
if (!this.hasPetMount) {
|
if (!this.hasPetMount) {
|
||||||
res = Bitmap.createBitmap(res, 25, 18, compactWidth, compactHeight);
|
res = Bitmap.createBitmap(res, 25, 18, COMPACT_WIDTH, COMPACT_HEIGHT);
|
||||||
}
|
}
|
||||||
BitmapUtils.saveToFile(currentCacheFileName, res);
|
BitmapUtils.saveToFile(currentCacheFileName, res);
|
||||||
if (this.imageView != null) {
|
if (this.imageView != null) {
|
||||||
|
|
|
||||||
|
|
@ -11,20 +11,20 @@ import java.util.HashMap;
|
||||||
*/
|
*/
|
||||||
public class ChatMessage {
|
public class ChatMessage {
|
||||||
|
|
||||||
static HashMap<Integer, Integer> contributorColorDict;
|
private static final HashMap<Integer, Integer> CONTRIBUTOR_COLOR_DICT;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
contributorColorDict = new HashMap<>();
|
CONTRIBUTOR_COLOR_DICT = new HashMap<>();
|
||||||
contributorColorDict.put(0, R.color.contributor_0);
|
CONTRIBUTOR_COLOR_DICT.put(0, R.color.contributor_0);
|
||||||
contributorColorDict.put(1, R.color.contributor_1);
|
CONTRIBUTOR_COLOR_DICT.put(1, R.color.contributor_1);
|
||||||
contributorColorDict.put(2, R.color.contributor_2);
|
CONTRIBUTOR_COLOR_DICT.put(2, R.color.contributor_2);
|
||||||
contributorColorDict.put(3, R.color.contributor_3);
|
CONTRIBUTOR_COLOR_DICT.put(3, R.color.contributor_3);
|
||||||
contributorColorDict.put(4, R.color.contributor_4);
|
CONTRIBUTOR_COLOR_DICT.put(4, R.color.contributor_4);
|
||||||
contributorColorDict.put(5, R.color.contributor_5);
|
CONTRIBUTOR_COLOR_DICT.put(5, R.color.contributor_5);
|
||||||
contributorColorDict.put(6, R.color.contributor_6);
|
CONTRIBUTOR_COLOR_DICT.put(6, R.color.contributor_6);
|
||||||
contributorColorDict.put(7, R.color.contributor_7);
|
CONTRIBUTOR_COLOR_DICT.put(7, R.color.contributor_7);
|
||||||
contributorColorDict.put(8, R.color.contributor_mod);
|
CONTRIBUTOR_COLOR_DICT.put(8, R.color.contributor_mod);
|
||||||
contributorColorDict.put(9, R.color.contributor_staff);
|
CONTRIBUTOR_COLOR_DICT.put(9, R.color.contributor_staff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -51,8 +51,8 @@ public class ChatMessage {
|
||||||
|
|
||||||
|
|
||||||
if (contributor != null) {
|
if (contributor != null) {
|
||||||
if (contributorColorDict.containsKey(contributor.level)) {
|
if (CONTRIBUTOR_COLOR_DICT.containsKey(contributor.level)) {
|
||||||
rColor = contributorColorDict.get(contributor.level);
|
rColor = CONTRIBUTOR_COLOR_DICT.get(contributor.level);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,12 @@ import java.util.concurrent.TimeUnit;
|
||||||
@ModelContainer
|
@ModelContainer
|
||||||
@Table(databaseName = HabitDatabase.NAME)
|
@Table(databaseName = HabitDatabase.NAME)
|
||||||
public class Task extends BaseModel {
|
public class Task extends BaseModel {
|
||||||
public static String TYPE_HABIT = "habit";
|
public static final String TYPE_HABIT = "habit";
|
||||||
public static String TYPE_TODO = "todo";
|
public static final String TYPE_TODO = "todo";
|
||||||
public static String TYPE_DAILY = "daily";
|
public static final String TYPE_DAILY = "daily";
|
||||||
public static String TYPE_REWARD = "reward";
|
public static final String TYPE_REWARD = "reward";
|
||||||
public static String FREQUENCY_WEEKLY = "weekly";
|
public static final String FREQUENCY_WEEKLY = "weekly";
|
||||||
public static String FREQUENCY_DAILY = "daily";
|
public static final String FREQUENCY_DAILY = "daily";
|
||||||
|
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue