Skip to content

Commit

Permalink
some more cleaning of the Logs
Browse files Browse the repository at this point in the history
  • Loading branch information
neuracr committed Mar 10, 2019
1 parent a258cf7 commit 93ed312
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 136 deletions.
44 changes: 0 additions & 44 deletions app/src/main/java/team23/binaryclock/ClockFace.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package team23.binaryclock;

import android.util.Log;

import java.util.ArrayList;
import java.util.Calendar;

Expand Down Expand Up @@ -43,49 +41,8 @@ else if(i/2 == 2){
this.bitGrid.add(row);
}

//Log.i("ClockFace", "number of rows:" + table.getChildCount());
//Log.i("ClockFace", "number of rows:" + ((TableRow)table.getChildAt(0)).getChildCount());

//ArrayList<View> column = getColumn(0);
//column.addAll(getColumn(1));
//this.h = new NumberFace(h_ids, 24, views);
//column = getColumn(2);
//column.addAll(getColumn(3));
//this.m = new NumberFace(m_ids, 60, views);
//column = getColumn(4);
//column.addAll(getColumn(5));
//this.s = new NumberFace(s_ids, 60, views);
}
/*
public ClockFace(TableLayout table){
this.table = table;
Log.i("ClockFace", "number of rows:" + table.getChildCount());
Log.i("ClockFace", "number of rows:" + ((TableRow)table.getChildAt(0)).getChildCount());
ArrayList<View> column = getColumn(0);
column.addAll(getColumn(1));
this.h = new NumberFace(column, 24);
column = getColumn(2);
column.addAll(getColumn(3));
this.m = new NumberFace(column, 60);
column = getColumn(4);
column.addAll(getColumn(5));
this.s = new NumberFace(column, 60);
s.increment();
s.increment();
s.increment();
s.increment();
m.increment();
}

private ArrayList<View> getColumn(int number){
ArrayList<View> column = new ArrayList<View>();
for (int i=0 ; i < this.table.getChildCount() ; i++){
column.add(((TableRow)this.table.getChildAt(i)).getChildAt(number));
}
return column;
}
*/
public void setTime(){
Calendar now = Calendar.getInstance();
int hour = now.get(Calendar.HOUR_OF_DAY);
Expand All @@ -103,7 +60,6 @@ public boolean get(int x, int y){
return false;
}
NfBitTuple tuple = this.bitGrid.get(x).get(y);
//Log.i("ClockFace","getValue " + x + ", " + y + " val:" + tuple.getNf().getValue());

return tuple.getNf().getBit(tuple.getBit());
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/team23/binaryclock/ClockService.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public long getItemId(int position) {

@Override
public boolean hasStableIds() {
Log.i("callback", "hasStableIds()");
//Log.i("callback", "hasStableIds()");
return true;
}
}
Expand Down
69 changes: 0 additions & 69 deletions app/src/main/java/team23/binaryclock/ClockWidget.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package team23.binaryclock;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.widget.RemoteViews;

import java.time.Clock;

/**
* Implementation of App Widget functionality.
Expand Down Expand Up @@ -41,82 +37,17 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a
views.setRemoteAdapter(R.id.face, intent);
appWidgetManager.updateAppWidget(appWidgetId, views);


/*for (int appWidgetId : appWidgetIds){
Intent intent = new Intent(context, SettingsActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
Intent serviceIntent = new Intent(context, ClockService.class);
serviceIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
serviceIntent.setData(Uri.parse(serviceIntent.toUri(Intent.URI_INTENT_SCHEME)));
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_clock);
views.setRemoteAdapter(R.id.face, serviceIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);*/
}
}

@Override
public void onEnabled(Context context) {
/*// Enter relevant functionality for when the first widget is created
this.handler = new Handler(){
@Override
public void handleMessage(Message m){
super.handleMessage(m);
if (m.what == TICK_MESSAGE) {
updateAll();
}
}
};*/
//this.views = new RemoteViews(context.getPackageName(), R.layout.widget_clock);
//this.clockFace = new ClockFace(views);
}

@Override
public void onDisabled(Context context) {
// Enter relevant functionality for when the last widget is disabled
}

/*
setContentView(R.layout.activity_settings);
this.clockFace = new ClockFace((TableLayout)findViewById(R.id.face));
Sample application
The code excerpts in this section are drawn from the StackWidget sample:
final Thread t = new Thread(new Runnable() {
@Override
public void run() {
int TICKS_IN_A_ROW = 50;
//set the widget_clock for the first time
tick.sendEmptyMessage(TICK_MESSAGE);
//tries to land on the top of each second
while(true) {
Calendar c = Calendar.getInstance();
int offset = c.get(Calendar.MILLISECOND);
long nextTime = SystemClock.uptimeMillis() + 1000 - offset;
for (int i=0 ; i < TICKS_IN_A_ROW ; i++) {
tick.sendEmptyMessageAtTime(TICK_MESSAGE, nextTime + i*1000);
}
try {
Thread.sleep(TICKS_IN_A_ROW * 1000);
}
catch (InterruptedException e){
}
}
}
});
t.start();
*/



}

2 changes: 0 additions & 2 deletions app/src/main/java/team23/binaryclock/GradientSkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Parcel;
import android.os.Parcelable;
Expand Down
20 changes: 1 addition & 19 deletions app/src/main/java/team23/binaryclock/NumberFace.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
package team23.binaryclock;

import android.util.Log;
import android.view.View;
import android.widget.RemoteViews;

import java.math.RoundingMode;
import java.util.ArrayList;

public class NumberFace {
private int modulo;
Expand All @@ -21,19 +15,7 @@ public NumberFace(int size, int modulo){
bits[id] = false;
}
}
/*
public void increment(){
for (int i=bits.size()-1; i>=0; i--){
if (!bits.get(i).isActivated()){
bits.get(i).setActivated(true);
break;
}
else{
bits.get(i).setActivated(false);
}
}
}
*/

public void setNumber(int value){
int i=0;
this.value = value;
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="pumpkin_orange">#999999</color>
</resources>

0 comments on commit 93ed312

Please sign in to comment.