Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
programminghoch10 committed Sep 16, 2019
2 parents ed27832 + 6dd5819 commit 6a37380
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 584 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ Welcome to HangoverClock, the only clock which displays the real time in an unre
If you just want to see what this widget looks like now,
please click [here](https://github.com/programminghoch10/HangoverClock#the-next-generation)

[Download from Play Store](https://play.google.com/store/apps/details?id=com.JJ.hangoverclock)

[Download the newest APK](https://github.com/programminghoch10/HangoverClock/raw/master/app/release/app-release.apk)
or look at the
[latest stable releases](https://github.com/programminghoch10/HangoverClock/releases)

For Wear OS Users, please look [here](https://github.com/programminghoch10/HangoverClock/tree/weardev)

![HangoverClock Icon new](icon/clock.png)
![HangoverClock Icon old](app/src/main/res/drawable-v24/clock.png)
![HangoverClock Icon new](icon/clockc.png)
![HangoverClock Icon old](icon/clock.png)

## What makes HangoverClock special?

Expand Down Expand Up @@ -50,6 +52,8 @@ So my friends inspired me saying the idea is amazing, but the clocks design suck

## The next generation

![HangoverClock Dynamite Google Play Banner](pictures/playbannercutted.png)

![HangoverClock Dynamite Picture 1](pictures/dynamite1.jpg)
![HangoverClock Dynamite Picture 2](pictures/dynamite2.png)
(background not included)
Expand Down Expand Up @@ -114,4 +118,15 @@ I'm always on the quest to make this the best HangoverClock ever.
## Thanksgiving

Thanks to all my friends, who motivated me to do this.
Also thanks to my laptop, which crashed 2 times with literally nothing saved to disk.
Also thanks to my laptop, which crashed 2 times with literally nothing saved to disk.

 

## Screenshots

![Screenshot 1](pictures/playphone.png)
![Screenshot 2](pictures/playphoneconfig.png)

![Screenshot 3](pictures/play10inch.png)

![Screenshot 4](pictures/play7inch.png)
708 changes: 354 additions & 354 deletions app/src/main/java/com/JJ/hangoverclock/ConfigureWidget.java

Large diffs are not rendered by default.

170 changes: 85 additions & 85 deletions app/src/main/java/com/JJ/hangoverclock/CustomSpinnerAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,96 +15,96 @@
import java.util.List;

public class CustomSpinnerAdapter extends ArrayAdapter<RowItem> {
private int spinner = R.id.spinnerview;
private String TAG = "CustomSpinnerAdapter";
private LayoutInflater flater;
CustomSpinnerAdapter(Activity context, int resouceId, int textviewId, List<RowItem> list) {
super(context, resouceId, textviewId, list);
flater = context.getLayoutInflater();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
RowItem rowItem = getItem(position);
View rowview = flater.inflate(R.layout.listitems_layout, null, true);

TextView txtTitle = (TextView) rowview.findViewById(spinner);
txtTitle.setText(rowItem.getTitle());
txtTitle.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
if (position == 0) return rowview;
try {
//Log.d(TAG, "getView: tf string is " + rowItem.getTitleFont(position));
//Log.d(TAG, "getView: identifier is " + getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName()));
//Log.d(TAG, "getView: typefont is " + ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
txtTitle.setTypeface(ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
} catch (Exception e) {
Log.e(TAG, "getView: error occured while determiting font", e);
}
return rowview;
}
@Override
public View getDropDownView(int position, View view, ViewGroup parent) {
if (view == null) {
view = flater.inflate(R.layout.listitems_layout, parent, false);
}
RowItem rowItem = getItem(position);
TextView txtTitle = (TextView) view.findViewById(spinner);
txtTitle.setText(rowItem.getTitle());
txtTitle.setTypeface(rowItem.getTypeface());
return view;
}
private int spinner = R.id.spinnerview;
private String TAG = "CustomSpinnerAdapter";
private LayoutInflater flater;
CustomSpinnerAdapter(Activity context, int resouceId, int textviewId, List<RowItem> list) {
super(context, resouceId, textviewId, list);
flater = context.getLayoutInflater();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
RowItem rowItem = getItem(position);
View rowview = flater.inflate(R.layout.listitems_layout, null, true);
TextView txtTitle = rowview.findViewById(spinner);
txtTitle.setText(rowItem.getTitle());
txtTitle.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
if (position == 0) return rowview;
try {
//Log.d(TAG, "getView: tf string is " + rowItem.getTitleFont(position));
//Log.d(TAG, "getView: identifier is " + getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName()));
//Log.d(TAG, "getView: typefont is " + ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
txtTitle.setTypeface(ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
} catch (Exception e) {
Log.e(TAG, "getView: error occured while determiting font", e);
}
return rowview;
}
@Override
public View getDropDownView(int position, View view, ViewGroup parent) {
if (view == null) {
view = flater.inflate(R.layout.listitems_layout, parent, false);
}
RowItem rowItem = getItem(position);
TextView txtTitle = view.findViewById(spinner);
txtTitle.setText(rowItem.getTitle());
txtTitle.setTypeface(rowItem.getTypeface());
return view;
}
}


class RowItem {

private final static String TAG = "rowitem";
private String title;
private Typeface typeface;
private int visibility;

RowItem(Context context, String title, int position) {
this.title = title;
if (position == 0) {
typeface = Typeface.defaultFromStyle(Typeface.NORMAL);
return;
}
try {
//Log.d(TAG, "getView: tf string is " + rowItem.getTitleFont(position));
//Log.d(TAG, "getView: identifier is " + getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName()));
//Log.d(TAG, "getView: typefont is " + ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
typeface = ResourcesCompat.getFont(context, context.getResources().getIdentifier(getTitleFont(position), "font", context.getPackageName()));
} catch (Exception e) {
Log.e(TAG, "getView: error occured while determiting font "+title, e);
//visibility = View.GONE;
visibility = View.INVISIBLE;
}
}

String getTitle() {
return title;
}

String getTitleFont(int position) {
return ClockWidgetProvider.fonts.get(position).replace(" ", "_");
}

Typeface getTypeface() {
return typeface;
}
private final static String TAG = "rowitem";
private String title;
private Typeface typeface;
private int visibility;

RowItem(Context context, String title, int position) {
this.title = title;
if (position == 0) {
typeface = Typeface.defaultFromStyle(Typeface.NORMAL);
return;
}
try {
//Log.d(TAG, "getView: tf string is " + rowItem.getTitleFont(position));
//Log.d(TAG, "getView: identifier is " + getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName()));
//Log.d(TAG, "getView: typefont is " + ResourcesCompat.getFont(getContext(), getContext().getResources().getIdentifier(rowItem.getTitleFont(position), "font", getContext().getPackageName())));
typeface = ResourcesCompat.getFont(context, context.getResources().getIdentifier(getTitleFont(position), "font", context.getPackageName()));
} catch (Exception e) {
Log.e(TAG, "getView: error occured while determiting font " + title, e);
//visibility = View.GONE;
visibility = View.INVISIBLE;
}
}

String getTitle() {
return title;
}

String getTitleFont(int position) {
return ClockWidgetProvider.fonts.get(position).replace(" ", "_");
}

Typeface getTypeface() {
return typeface;
}

int getVisibility() {
return visibility;
}
int getVisibility() {
return visibility;
}

@Override
public String toString() {
return title;
}
@Override
public String toString() {
return title;
}
}
Loading

0 comments on commit 6a37380

Please sign in to comment.