Add history list item

filtering
Floens 10 years ago
parent 8addec9797
commit cfe69349d4
  1. 12
      Clover/app/src/main/java/org/floens/chan/ui/adapter/PinAdapter.java
  2. 6
      Clover/app/src/main/java/org/floens/chan/ui/controller/RootNavigationController.java
  3. 1
      Clover/app/src/main/java/org/floens/chan/ui/theme/DarkTheme.java
  4. 2
      Clover/app/src/main/java/org/floens/chan/ui/theme/Theme.java
  5. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_history_black_24dp.png
  6. BIN
      Clover/app/src/main/res/drawable-hdpi/ic_history_white_24dp.png
  7. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_history_black_24dp.png
  8. BIN
      Clover/app/src/main/res/drawable-mdpi/ic_history_white_24dp.png
  9. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_history_black_24dp.png
  10. BIN
      Clover/app/src/main/res/drawable-xhdpi/ic_history_white_24dp.png
  11. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_history_black_24dp.png
  12. BIN
      Clover/app/src/main/res/drawable-xxhdpi/ic_history_white_24dp.png
  13. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_history_black_24dp.png
  14. BIN
      Clover/app/src/main/res/drawable-xxxhdpi/ic_history_white_24dp.png
  15. 2
      Clover/app/src/main/res/values/strings.xml

@ -44,7 +44,7 @@ import static org.floens.chan.utils.AndroidUtils.setRoundItemBackground;
import static org.floens.chan.utils.AndroidUtils.sp;
public class PinAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements SwipeListener.Callback {
private static final int PIN_OFFSET = 1;
private static final int PIN_OFFSET = 2;
private static final int TYPE_HEADER = 0;
private static final int TYPE_PIN = 1;
@ -92,9 +92,9 @@ public class PinAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> im
case TYPE_LINK:
LinkHolder linkHolder = (LinkHolder) holder;
switch (position) {
case 1:
linkHolder.text.setText(R.string.settings_screen);
theme().settingsDrawable.apply(linkHolder.image);
case 0:
linkHolder.text.setText(R.string.history_screen);
theme().historyDrawable.apply(linkHolder.image);
break;
}
break;
@ -123,6 +123,8 @@ public class PinAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> im
public int getItemViewType(int position) {
switch (position) {
case 0:
return TYPE_LINK;
case 1:
return TYPE_HEADER;
default:
return TYPE_PIN;
@ -367,5 +369,7 @@ public class PinAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> im
void onPinRemoved(Pin pin);
void onPinLongClocked(Pin pin);
void openHistory();
}
}

@ -51,6 +51,7 @@ import java.util.List;
import de.greenrobot.event.EventBus;
import static org.floens.chan.ui.theme.ThemeHelper.theme;
import static org.floens.chan.utils.AndroidUtils.ROBOTO_MEDIUM;
import static org.floens.chan.utils.AndroidUtils.dp;
import static org.floens.chan.utils.AndroidUtils.getAttrColor;
@ -86,6 +87,7 @@ public class RootNavigationController extends NavigationController implements Pi
settings = (LinearLayout) view.findViewById(R.id.settings);
settings.setOnClickListener(this);
theme().settingsDrawable.apply((ImageView) settings.findViewById(R.id.image));
((TextView) settings.findViewById(R.id.text)).setTypeface(ROBOTO_MEDIUM);
toolbar.setBackgroundColor(ThemeHelper.getInstance().getTheme().primaryColor.color);
@ -249,6 +251,10 @@ public class RootNavigationController extends NavigationController implements Pi
dialog.show();
}
@Override
public void openHistory() {
}
public void onEvent(WatchManager.PinAddedMessage message) {
pinAdapter.onPinAdded(message.pin);
drawerLayout.openDrawer(drawer);

@ -16,5 +16,6 @@ public class DarkTheme extends Theme {
clearDrawable = new ThemeDrawable(R.drawable.ic_clear_white_24dp, 1f);
backDrawable = new ThemeDrawable(R.drawable.ic_arrow_back_white_24dp, 1f);
doneDrawable = new ThemeDrawable(R.drawable.ic_done_white_24dp, 1f);
historyDrawable = new ThemeDrawable(R.drawable.ic_history_white_24dp, 1f);
}
}

@ -61,6 +61,7 @@ public class Theme {
public ThemeDrawable clearDrawable;
public ThemeDrawable backDrawable;
public ThemeDrawable doneDrawable;
public ThemeDrawable historyDrawable;
public Theme(String displayName, String name, int resValue, ThemeHelper.PrimaryColor primaryColor) {
this.displayName = displayName;
@ -79,6 +80,7 @@ public class Theme {
clearDrawable = new ThemeDrawable(R.drawable.ic_clear_black_24dp, 0.54f);
backDrawable = new ThemeDrawable(R.drawable.ic_arrow_back_black_24dp, 0.54f);
doneDrawable = new ThemeDrawable(R.drawable.ic_done_black_24dp, 0.54f);
historyDrawable = new ThemeDrawable(R.drawable.ic_history_black_24dp, 0.54f);
}
private void resolveSpanColors() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -180,6 +180,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<item quantity="other">%1$d new posts, %2$d quoting you</item>
</plurals>
<string name="history_screen">History</string>
<string name="settings_screen">Settings</string>
<string name="settings_group_general">General</string>
<string name="settings_board_edit">Boards</string>

Loading…
Cancel
Save