Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 49 KiB |
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
*
|
||||
* This file is part of Loop Habit Tracker.
|
||||
*
|
||||
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.isoron.uhabits.widgets
|
||||
|
||||
import android.content.*
|
||||
import android.view.*
|
||||
import org.isoron.uhabits.widgets.views.*
|
||||
|
||||
class EmptyWidget(
|
||||
context: Context,
|
||||
widgetId: Int
|
||||
) : BaseWidget(context, widgetId) {
|
||||
|
||||
override fun getOnClickPendingIntent(context: Context) = null
|
||||
override fun refreshData(v: View) {}
|
||||
override fun buildView() = EmptyWidgetView(context)
|
||||
override fun getDefaultHeight() = 200
|
||||
override fun getDefaultWidth() = 200
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
*
|
||||
* This file is part of Loop Habit Tracker.
|
||||
*
|
||||
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.isoron.uhabits.widgets
|
||||
|
||||
import android.appwidget.*
|
||||
import android.content.*
|
||||
import android.net.*
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import org.isoron.uhabits.core.models.*
|
||||
import org.isoron.uhabits.core.utils.*
|
||||
|
||||
class StackWidget(
|
||||
context: Context,
|
||||
widgetId: Int,
|
||||
private val widgetType: StackWidgetType,
|
||||
private val habits: List<Habit>
|
||||
) : BaseWidget(context, widgetId) {
|
||||
|
||||
override fun getOnClickPendingIntent(context: Context) = null
|
||||
|
||||
override fun refreshData(v: View) {
|
||||
// unused
|
||||
}
|
||||
|
||||
override fun getRemoteViews(width: Int, height: Int): RemoteViews {
|
||||
val manager = AppWidgetManager.getInstance(context)
|
||||
val remoteViews = RemoteViews(context.packageName, StackWidgetType.getStackWidgetLayoutId(widgetType))
|
||||
val serviceIntent = Intent(context, StackWidgetService::class.java)
|
||||
val habitIds = StringUtils.joinLongs(habits.map { it.id!! }.toLongArray())
|
||||
|
||||
serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id)
|
||||
serviceIntent.putExtra(StackWidgetService.WIDGET_TYPE, widgetType.value)
|
||||
serviceIntent.putExtra(StackWidgetService.HABIT_IDS, habitIds)
|
||||
serviceIntent.data = Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME))
|
||||
remoteViews.setRemoteAdapter(StackWidgetType.getStackWidgetAdapterViewId(widgetType), serviceIntent)
|
||||
manager.notifyAppWidgetViewDataChanged(id, StackWidgetType.getStackWidgetAdapterViewId(widgetType))
|
||||
remoteViews.setEmptyView(StackWidgetType.getStackWidgetAdapterViewId(widgetType),
|
||||
StackWidgetType.getStackWidgetEmptyViewId(widgetType))
|
||||
return remoteViews
|
||||
}
|
||||
|
||||
override fun buildView() = null // unused
|
||||
override fun getDefaultHeight() = 0 // unused
|
||||
override fun getDefaultWidth() = 0 // unused
|
||||
}
|
@ -0,0 +1,163 @@
|
||||
package org.isoron.uhabits.widgets;
|
||||
|
||||
import android.appwidget.*;
|
||||
import android.content.*;
|
||||
import android.os.*;
|
||||
import android.support.annotation.*;
|
||||
import android.util.Log;
|
||||
import android.widget.*;
|
||||
|
||||
import org.isoron.uhabits.*;
|
||||
import org.isoron.uhabits.core.models.*;
|
||||
import org.isoron.uhabits.core.utils.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static android.appwidget.AppWidgetManager.*;
|
||||
import static org.isoron.androidbase.utils.InterfaceUtils.dpToPixels;
|
||||
import static org.isoron.uhabits.widgets.StackWidgetService.*;
|
||||
|
||||
public class StackWidgetService extends RemoteViewsService
|
||||
{
|
||||
public static final String WIDGET_TYPE = "WIDGET_TYPE";
|
||||
public static final String HABIT_IDS = "HABIT_IDS";
|
||||
|
||||
@Override
|
||||
public RemoteViewsFactory onGetViewFactory(Intent intent)
|
||||
{
|
||||
return new StackRemoteViewsFactory(this.getApplicationContext(), intent);
|
||||
}
|
||||
}
|
||||
|
||||
class StackRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory
|
||||
{
|
||||
private Context context;
|
||||
private int widgetId;
|
||||
private long[] habitIds;
|
||||
private StackWidgetType widgetType;
|
||||
private ArrayList<RemoteViews> remoteViews = new ArrayList<>();
|
||||
|
||||
public StackRemoteViewsFactory(Context context, Intent intent)
|
||||
{
|
||||
this.context = context;
|
||||
widgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
|
||||
AppWidgetManager.INVALID_APPWIDGET_ID);
|
||||
int widgetTypeValue = intent.getIntExtra(WIDGET_TYPE, -1);
|
||||
String habitIdsStr = intent.getStringExtra(HABIT_IDS);
|
||||
|
||||
if (widgetTypeValue < 0) throw new RuntimeException("invalid widget type");
|
||||
if (habitIdsStr == null) throw new RuntimeException("habitIdsStr is null");
|
||||
|
||||
widgetType = StackWidgetType.getWidgetTypeFromValue(widgetTypeValue);
|
||||
habitIds = StringUtils.splitLongs(habitIdsStr);
|
||||
}
|
||||
|
||||
public void onCreate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void onDestroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return habitIds.length;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public WidgetDimensions getDimensionsFromOptions(@NonNull Context ctx,
|
||||
@NonNull Bundle options)
|
||||
{
|
||||
int maxWidth = (int) dpToPixels(ctx, options.getInt(OPTION_APPWIDGET_MAX_WIDTH));
|
||||
int maxHeight = (int) dpToPixels(ctx, options.getInt(OPTION_APPWIDGET_MAX_HEIGHT));
|
||||
int minWidth = (int) dpToPixels(ctx, options.getInt(OPTION_APPWIDGET_MIN_WIDTH));
|
||||
int minHeight = (int) dpToPixels(ctx, options.getInt(OPTION_APPWIDGET_MIN_HEIGHT));
|
||||
|
||||
return new WidgetDimensions(minWidth, maxHeight, maxWidth, minHeight);
|
||||
}
|
||||
|
||||
public RemoteViews getViewAt(int position)
|
||||
{
|
||||
Log.i("StackRemoteViewsFactory", "getViewAt " + position);
|
||||
if (position < 0 || position > remoteViews.size()) return null;
|
||||
return remoteViews.get(position);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private BaseWidget constructWidget(@NonNull Habit habit)
|
||||
{
|
||||
switch (widgetType)
|
||||
{
|
||||
case CHECKMARK:
|
||||
return new CheckmarkWidget(context, widgetId, habit);
|
||||
case FREQUENCY:
|
||||
return new FrequencyWidget(context, widgetId, habit);
|
||||
case SCORE:
|
||||
return new ScoreWidget(context, widgetId, habit);
|
||||
case HISTORY:
|
||||
return new HistoryWidget(context, widgetId, habit);
|
||||
case STREAKS:
|
||||
return new StreakWidget(context, widgetId, habit);
|
||||
}
|
||||
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public RemoteViews getLoadingView()
|
||||
{
|
||||
Bundle options = AppWidgetManager.getInstance(context).getAppWidgetOptions(widgetId);
|
||||
EmptyWidget widget = new EmptyWidget(context, widgetId);
|
||||
widget.setDimensions(getDimensionsFromOptions(context, options));
|
||||
RemoteViews landscapeViews = widget.getLandscapeRemoteViews();
|
||||
RemoteViews portraitViews = widget.getPortraitRemoteViews();
|
||||
return new RemoteViews(landscapeViews, portraitViews);
|
||||
}
|
||||
|
||||
public int getViewTypeCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public long getItemId(int position)
|
||||
{
|
||||
return habitIds[position];
|
||||
}
|
||||
|
||||
public boolean hasStableIds()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onDataSetChanged()
|
||||
{
|
||||
Log.i("StackRemoteViewsFactory", "onDataSetChanged started");
|
||||
|
||||
HabitsApplication app = (HabitsApplication) context.getApplicationContext();
|
||||
HabitList habitList = app.getComponent().getHabitList();
|
||||
Bundle options = AppWidgetManager.getInstance(context).getAppWidgetOptions(widgetId);
|
||||
ArrayList<RemoteViews> newRemoteViews = new ArrayList<>();
|
||||
|
||||
if (Looper.myLooper() == null) Looper.prepare();
|
||||
|
||||
for (long id : habitIds)
|
||||
{
|
||||
Habit h = habitList.getById(id);
|
||||
if (h == null) throw new HabitNotFoundException();
|
||||
|
||||
BaseWidget widget = constructWidget(h);
|
||||
widget.setDimensions(getDimensionsFromOptions(context, options));
|
||||
|
||||
RemoteViews landscapeViews = widget.getLandscapeRemoteViews();
|
||||
RemoteViews portraitViews = widget.getPortraitRemoteViews();
|
||||
newRemoteViews.add(new RemoteViews(landscapeViews, portraitViews));
|
||||
|
||||
Log.i("StackRemoteViewsFactory", "onDataSetChanged constructed widget " + id);
|
||||
}
|
||||
|
||||
remoteViews = newRemoteViews;
|
||||
Log.i("StackRemoteViewsFactory", "onDataSetChanged ended");
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package org.isoron.uhabits.widgets;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
/**
|
||||
* Created by victoryu on 11/3/17.
|
||||
*/
|
||||
|
||||
public enum StackWidgetType {
|
||||
|
||||
CHECKMARK(0),
|
||||
FREQUENCY(1),
|
||||
SCORE(2), // habit strength widget
|
||||
HISTORY(3),
|
||||
STREAKS(4);
|
||||
|
||||
private int value;
|
||||
StackWidgetType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StackWidgetType getWidgetTypeFromValue(int value) {
|
||||
if (CHECKMARK.getValue() == value) {
|
||||
return CHECKMARK;
|
||||
} else if (FREQUENCY.getValue() == value) {
|
||||
return FREQUENCY;
|
||||
} else if (SCORE.getValue() == value) {
|
||||
return SCORE;
|
||||
} else if (HISTORY.getValue() == value) {
|
||||
return HISTORY;
|
||||
} else if (STREAKS.getValue() == value) {
|
||||
return STREAKS;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getStackWidgetLayoutId(StackWidgetType type) {
|
||||
switch (type) {
|
||||
case CHECKMARK:
|
||||
return R.layout.checkmark_stackview_widget;
|
||||
case FREQUENCY:
|
||||
return R.layout.frequency_stackview_widget;
|
||||
case SCORE:
|
||||
return R.layout.score_stackview_widget;
|
||||
case HISTORY:
|
||||
return R.layout.history_stackview_widget;
|
||||
case STREAKS:
|
||||
return R.layout.streak_stackview_widget;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getStackWidgetAdapterViewId(StackWidgetType type) {
|
||||
switch (type) {
|
||||
case CHECKMARK:
|
||||
return R.id.checkmarkStackWidgetView;
|
||||
case FREQUENCY:
|
||||
return R.id.frequencyStackWidgetView;
|
||||
case SCORE:
|
||||
return R.id.scoreStackWidgetView;
|
||||
case HISTORY:
|
||||
return R.id.historyStackWidgetView;
|
||||
case STREAKS:
|
||||
return R.id.streakStackWidgetView;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getStackWidgetEmptyViewId(StackWidgetType type) {
|
||||
switch (type) {
|
||||
case CHECKMARK:
|
||||
return R.id.checkmarkStackWidgetEmptyView;
|
||||
case FREQUENCY:
|
||||
return R.id.frequencyStackWidgetEmptyView;
|
||||
case SCORE:
|
||||
return R.id.scoreStackWidgetEmptyView;
|
||||
case HISTORY:
|
||||
return R.id.historyStackWidgetEmptyView;
|
||||
case STREAKS:
|
||||
return R.id.streakStackWidgetEmptyView;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
*
|
||||
* This file is part of Loop Habit Tracker.
|
||||
*
|
||||
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.isoron.uhabits.widgets.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.isoron.uhabits.R;
|
||||
|
||||
public class EmptyWidgetView extends HabitWidgetView
|
||||
{
|
||||
|
||||
private TextView title;
|
||||
|
||||
public EmptyWidgetView(Context context)
|
||||
{
|
||||
super(context);
|
||||
init();
|
||||
}
|
||||
|
||||
public void setTitle(String text)
|
||||
{
|
||||
title.setText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
protected Integer getInnerLayoutId()
|
||||
{
|
||||
return R.layout.widget_graph;
|
||||
}
|
||||
|
||||
private void init()
|
||||
{
|
||||
title = (TextView) findViewById(R.id.title);
|
||||
title.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<StackView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/checkmarkStackWidgetView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:loopViews="true" />
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/checkmarkStackWidgetEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/checkmark_stack_widget"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
</FrameLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<StackView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/frequencyStackWidgetView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:loopViews="true" />
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/frequencyStackWidgetEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/frequency_stack_widget"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
</FrameLayout>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/listItemHabitName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/listItemHabitCheckbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false" />
|
||||
</LinearLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<StackView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/historyStackWidgetView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:loopViews="true" />
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/historyStackWidgetEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/history_stack_widget"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
</FrameLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<StackView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/scoreStackWidgetView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:loopViews="true" />
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/scoreStackWidgetEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/score_stack_widget"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
</FrameLayout>
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
~
|
||||
~ This file is part of Loop Habit Tracker.
|
||||
~
|
||||
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by the
|
||||
~ Free Software Foundation, either version 3 of the License, or (at your
|
||||
~ option) any later version.
|
||||
~
|
||||
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
~ more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License along
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/stackWidgetListView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="1" >
|
||||
|
||||
</ListView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/doneConfigureButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/done_label" />
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<StackView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/streakStackWidgetView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:loopViews="true" />
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/streakStackWidgetEmptyView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/streaks_stack_widget"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
</FrameLayout>
|
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2016 Álinson Santos Xavier <isoron@gmail.com>
|
||||
~
|
||||
~ This file is part of Loop Habit Tracker.
|
||||
~
|
||||
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by the
|
||||
~ Free Software Foundation, either version 3 of the License, or (at your
|
||||
~ option) any later version.
|
||||
~
|
||||
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
~ more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License along
|
||||
~ with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<FrameLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/frame"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/innerFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingBottom="4dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 15 KiB |