Skip to content

Commit

Permalink
うごけ〜〜〜
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-24v committed Nov 6, 2015
1 parent dc47110 commit c5c41b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/com/joken/survey2015/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

private void setHuman(){
int index = this.getSharedPreferences(MAIN_PREF, MODE_PRIVATE).getInt(CURRENT_ID, 1000);
int index = this.getSharedPreferences(MAIN_PREF, MODE_PRIVATE).getInt(CURRENT_ID, 500);
human = new Human(index);
}

Expand Down Expand Up @@ -85,7 +85,7 @@ public void onClick(View v){
return bt;
}

private void setdata(){
private boolean setdata(){
TextView name = (TextView)findViewById(R.id.namearea)
,myage = (TextView)findViewById(R.id.myagearea)
,tgtagemin = (TextView)findViewById(R.id.tgtagearea1)
Expand All @@ -97,6 +97,7 @@ private void setdata(){
Integer.valueOf(tgtagemax.getText().toString()));
} catch (NumberFormatException e) {
showtoast("入力がおかしいよ");
return false;
}
ExpandableListView ls = (ExpandableListView)findViewById(R.id.questList);
Log.w(this.getLocalClassName(), ls.getExpandableListAdapter().toString());
Expand All @@ -108,10 +109,12 @@ private void setdata(){
}
}
name.setText(null);myage.setText(null);tgtagemin.setText(null);tgtagemax.setText(null);
return true;
}

//TODO IDを設定(1000~1999)
private void exportdata(){
//TODO IDを設定(1000~1999)->500~599に変更
private void exportdata(boolean isEnableExport){
if(!isEnableExport){return;}
int day = this.getSharedPreferences(MAIN_PREF, MODE_PRIVATE).getInt(DAY_VAL, 1);
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/joken/day"+day+".csv");
try{
Expand Down Expand Up @@ -190,8 +193,7 @@ private short parsesex(String sex){
public void onDialogCallback(int type){
switch(type){
case 0:
this.setdata();
this.exportdata();
this.exportdata(this.setdata());
break;
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/com/joken/survey2015/QuestExpandableAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@ private void setQuest(){
}
for(int j = 0; j < 4; j++){
ArrayList<QuestItem> q = new ArrayList<QuestItem>();
for(int i = j*questcount; i < j+questcount; i++){
for(int i = j*questcount; i < i+questcount; i++){
if(i >= questres.length){break;}
Log.d(this.getClass().getName(), "quest"+i);
q.add(new QuestItem(questres[i]));
}
Log.d(getLocalClassName(),q.toString());
children.add(q);
}
}

private void setGroup(){
int min = 1,max = questcount -1;
int min = 1,max = questcount;
for(int i = 0; i < children.size(); i++){
groups.add("問題" + min + "~" + max);
min += 10;
Expand Down

0 comments on commit c5c41b8

Please sign in to comment.