-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" > | ||
|
||
<TextView | ||
android:id="@+id/questText" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:textColor="@color/black" /> | ||
|
||
<RatingBar | ||
android:id="@+id/ratingBar" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:numStars="5" | ||
android:rating="0.0" | ||
android:stepSize="1.0" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.joken.survey2015; | ||
|
||
import java.util.ArrayList; | ||
|
||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.BaseExpandableListAdapter; | ||
import android.widget.TextView; | ||
|
||
public class QuestExpandableAdapter extends BaseExpandableListAdapter { | ||
private ArrayList<ArrayList<QuestItem>> children; | ||
private ArrayList<String> groups; | ||
private Context context; | ||
|
||
public QuestExpandableAdapter(Context ct) { | ||
// TODO Auto-generated constructor stub | ||
this.context = ct; | ||
this.children = new ArrayList<ArrayList<QuestItem>>(); | ||
this.groups = new ArrayList<String>(); | ||
} | ||
|
||
private View getBasicView(){ | ||
return LayoutInflater.from(context).inflate(R.layout.questitem, null); | ||
} | ||
|
||
@Override | ||
public Object getChild(int arg0, int arg1) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getChildId(int arg0, int arg1) { | ||
// TODO Auto-generated method stub | ||
return 0; | ||
} | ||
|
||
@Override | ||
public View getChildView(int arg0, int arg1, boolean arg2, View arg3, | ||
ViewGroup arg4) { | ||
// TODO Auto-generated method stub | ||
if(arg3 != null && arg4 != null){ | ||
return arg3; | ||
} | ||
View v = this.getBasicView(); | ||
TextView tv = (TextView)v.findViewById(R.id.questText); | ||
return v; | ||
} | ||
|
||
@Override | ||
public int getChildrenCount(int arg0) { | ||
// TODO Auto-generated method stub | ||
return 0; | ||
} | ||
|
||
@Override | ||
public Object getGroup(int arg0) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public int getGroupCount() { | ||
// TODO Auto-generated method stub | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getGroupId(int arg0) { | ||
// TODO Auto-generated method stub | ||
return 0; | ||
} | ||
|
||
@Override | ||
public View getGroupView(int arg0, boolean arg1, View arg2, ViewGroup arg3) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean hasStableIds() { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isChildSelectable(int arg0, int arg1) { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.joken.survey2015; | ||
|
||
public class QuestItem { | ||
private int questRaw; | ||
private short questAns; | ||
|
||
public QuestItem() { | ||
questRaw = R.array.quest_day1; | ||
} | ||
|
||
public int getName(){ | ||
return this.questRaw; | ||
} | ||
|
||
public void setQuestAns(short ans){ | ||
this.questAns = ans; | ||
} | ||
|
||
public short getQuestAns(){ | ||
return this.questAns; | ||
} | ||
|
||
} |