Skip to content

Commit f0c5e18

Browse files
authored
Merge pull request #359 from yadav-rahul/code-style-lowerCamelCase
Changed variable names to lowerCamelCase. Fixes #328
2 parents 0044a9f + 0fa8580 commit f0c5e18

32 files changed

+218
-216
lines changed

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/FirstRunActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ protected void onCreate(Bundle savedInstanceState) {
4646

4747

4848
findViewById(R.id.focus_thief).clearFocus();
49-
Animation anim_bounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
49+
Animation animBounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
5050
name = (EditText) findViewById(R.id.first_name);
51-
name.startAnimation(anim_bounceinup);
51+
name.startAnimation(animBounceinup);
5252
name.setOnKeyListener(new View.OnKeyListener() {
5353
@Override
5454
public boolean onKey(View v, int keyCode, KeyEvent event) {

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ public void handleMessage(Message message) {
100100
public void openBottomSheet (View v) {
101101

102102
View view = getLayoutInflater ().inflate (R.layout.bottom_sheet_view, null);
103-
TextView txt_save_apk = (TextView)view.findViewById( R.id.txt_save_apk);
104-
TextView txt_save_project = (TextView)view.findViewById( R.id.txt_save_project);
105-
TextView txt_share_apk = (TextView)view.findViewById( R.id.txt_share_apk);
106-
final TextView txt_shareProject = (TextView)view.findViewById( R.id.txt_share_project);
103+
TextView txtSaveApk = (TextView)view.findViewById( R.id.txt_save_apk);
104+
TextView txtSaveProject = (TextView)view.findViewById( R.id.txt_save_project);
105+
TextView txtShareApk = (TextView)view.findViewById( R.id.txt_share_apk);
106+
final TextView txtShareProject = (TextView)view.findViewById( R.id.txt_share_project);
107107

108108
final Dialog mBottomSheetDialog = new Dialog (TemplateEditor.this,
109109
R.style.MaterialDialogSheet);
@@ -116,7 +116,7 @@ public void openBottomSheet (View v) {
116116

117117

118118
//save project
119-
txt_save_project.setOnClickListener(new View.OnClickListener() {
119+
txtSaveProject.setOnClickListener(new View.OnClickListener() {
120120

121121
@Override
122122
public void onClick(View v) {
@@ -126,7 +126,7 @@ public void onClick(View v) {
126126
});
127127

128128
//share project
129-
txt_shareProject.setOnClickListener(new View.OnClickListener() {
129+
txtShareProject.setOnClickListener(new View.OnClickListener() {
130130

131131
@Override
132132
public void onClick(View v) {
@@ -135,26 +135,26 @@ public void onClick(View v) {
135135
}
136136
});
137137

138-
txt_share_apk.setOnClickListener(new View.OnClickListener() {
138+
txtShareApk.setOnClickListener(new View.OnClickListener() {
139139

140140
@Override
141141
public void onClick(View v) {
142-
share_apk();
142+
shareApk();
143143
mBottomSheetDialog.dismiss();
144144
}
145145
});
146146

147-
txt_save_apk.setOnClickListener(new View.OnClickListener() {
147+
txtSaveApk.setOnClickListener(new View.OnClickListener() {
148148

149149
@Override
150150
public void onClick(View v) {
151-
save_apk();
151+
saveApk();
152152
mBottomSheetDialog.dismiss();
153153
}
154154
});
155155
}
156156

157-
private void save_apk() {
157+
private void saveApk() {
158158
String savedFilePath;
159159
savedFilePath = saveProject();
160160
if (savedFilePath == null || savedFilePath.length() == 0) {
@@ -217,7 +217,7 @@ public void onFail(Exception e) {
217217
signer.start();
218218
}
219219

220-
private void share_apk() {
220+
private void shareApk() {
221221
String savedFilePath;
222222
savedFilePath = saveProject();
223223
if (savedFilePath == null || savedFilePath.length() == 0) {

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TutorialActivity.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ protected void onCreate(Bundle savedInstanceState) {
4343
mPager.addOnPageChangeListener(viewPagerPageChangeListener);
4444
}
4545

46-
private void addBottomDots(int current_slide) {
46+
private void addBottomDots(int currentSlide) {
4747
TextView[] dots = new TextView[Tutorial.values().length];
48-
int dot_colorActive = getResources().getColor(R.color.selected_dot);
48+
int dotColorActive = getResources().getColor(R.color.selected_dot);
4949

5050
indicatingDotsContainer.removeAllViews();
5151

@@ -59,9 +59,9 @@ private void addBottomDots(int current_slide) {
5959

6060
//dot corresponding to current slide is given active color i.e white color
6161
if (dots.length > 0) {
62-
dots[current_slide].setTextColor(dot_colorActive);
63-
dots[current_slide].setText(Html.fromHtml("•"));
64-
dots[current_slide].setTextSize(TypedValue.COMPLEX_UNIT_SP,32);
62+
dots[currentSlide].setTextColor(dotColorActive);
63+
dots[currentSlide].setText(Html.fromHtml("•"));
64+
dots[currentSlide].setTextSize(TypedValue.COMPLEX_UNIT_SP,32);
6565
}
6666
}
6767

source-code/app/src/main/java/org/buildmlearn/toolkit/adapter/TutorialAdapter.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ public void onClick(View v) {
7777
}
7878
});
7979
} else {
80+
8081
convertView = View.inflate(mActivity,R.layout.tutorial_layout, null);
81-
View skip_button = convertView.findViewById(R.id.skip_button);
82-
skip_button.setVisibility(View.GONE);
82+
View skipButton = convertView.findViewById(R.id.skip_button);
83+
skipButton.setVisibility(View.GONE);
84+
8385
ImageView deviceImage = (ImageView) convertView
8486
.findViewById(R.id.device_image);
8587
TextView title = (TextView) convertView
@@ -95,7 +97,7 @@ public void onClick(View v) {
9597
title.setText(tutorial.getTitle());
9698
description.setText(tutorial.getDescription());
9799
if(!SkipTutorial) {
98-
skip_button.setVisibility(View.VISIBLE);
100+
skipButton.setVisibility(View.VISIBLE);
99101
}
100102
convertView.findViewById(R.id.skip_button).setOnClickListener(new View.OnClickListener() {
101103
@Override

source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/data/ComprehensionDb.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ public int[] getStatistics() {
9494
Cursor cursor = getQuestionCursorById(i);
9595
cursor.moveToFirst();
9696

97-
String correct_answer = cursor.getString(Constants.COL_CORRECT_ANSWER);
97+
String correctAnswer = cursor.getString(Constants.COL_CORRECT_ANSWER);
9898
int attempted = cursor.getInt(Constants.COL_ATTEMPTED);
9999
if (attempted == 1) {
100100
String answer = cursor.getString(Constants.COL_ANSWERED);
101-
if (answer.equals(correct_answer)) {
101+
if (answer.equals(correctAnswer)) {
102102
stat[0]++;
103103
} else {
104104
stat[1]++;

source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public boolean onMenuItemClick(MenuItem menuItem) {
9999
Cursor cursor = db.getQuestionCursorById(Integer.parseInt(questionId));
100100
cursor.moveToFirst();
101101
String question = cursor.getString(Constants.COL_QUESTION);
102-
String option_1 = cursor.getString(Constants.COL_OPTION_1);
103-
String option_2 = cursor.getString(Constants.COL_OPTION_2);
104-
String option_3 = cursor.getString(Constants.COL_OPTION_3);
105-
String option_4 = cursor.getString(Constants.COL_OPTION_4);
102+
String optionOne = cursor.getString(Constants.COL_OPTION_1);
103+
String optionTwo = cursor.getString(Constants.COL_OPTION_2);
104+
String optionThree = cursor.getString(Constants.COL_OPTION_3);
105+
String optionFour = cursor.getString(Constants.COL_OPTION_4);
106106
int attempted = cursor.getInt(Constants.COL_ATTEMPTED);
107107
String answered;
108108

@@ -154,21 +154,21 @@ public boolean onMenuItemClick(MenuItem item) {
154154

155155
((TextView) rootView.findViewById(R.id.question_title)).setText(String.format(Locale.getDefault(), "Question No : %1$s", questionId));
156156
((TextView) rootView.findViewById(R.id.question)).setText(question);
157-
if (option_1 != null) {
157+
if (optionOne != null) {
158158
rootView.findViewById(R.id.radioButton1).setVisibility(View.VISIBLE);
159-
((TextView) rootView.findViewById(R.id.radioButton1)).setText(option_1);
159+
((TextView) rootView.findViewById(R.id.radioButton1)).setText(optionOne);
160160
}
161-
if (option_2 != null) {
161+
if (optionTwo != null) {
162162
rootView.findViewById(R.id.radioButton2).setVisibility(View.VISIBLE);
163-
((TextView) rootView.findViewById(R.id.radioButton2)).setText(option_2);
163+
((TextView) rootView.findViewById(R.id.radioButton2)).setText(optionTwo);
164164
}
165-
if (option_3 != null) {
165+
if (optionThree != null) {
166166
rootView.findViewById(R.id.radioButton3).setVisibility(View.VISIBLE);
167-
((TextView) rootView.findViewById(R.id.radioButton3)).setText(option_3);
167+
((TextView) rootView.findViewById(R.id.radioButton3)).setText(optionThree);
168168
}
169-
if (option_4 != null) {
169+
if (optionFour != null) {
170170
rootView.findViewById(R.id.radioButton4).setVisibility(View.VISIBLE);
171-
((TextView) rootView.findViewById(R.id.radioButton4)).setText(option_4);
171+
((TextView) rootView.findViewById(R.id.radioButton4)).setText(optionFour);
172172
}
173173

174174

source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/SplashFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
3939
final Activity mActivity = getActivity();
4040
final String result[] = DataUtils.readTitleAuthor();
4141
TextView title = (TextView) rootView.findViewById(R.id.title);
42-
TextView author_name = (TextView) rootView.findViewById(R.id.author_name);
42+
TextView authorName = (TextView) rootView.findViewById(R.id.author_name);
4343

4444
title.setText(result[0]);
45-
author_name.setText(result[1]);
45+
authorName.setText(result[1]);
4646
((TextViewPlus) rootView.findViewById(R.id.intro_text)).setText(getResources().getString(R.string.comprehension_title));
4747

4848

source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/DetailActivityFragment.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class DetailActivityFragment extends Fragment implements LoaderCallbacks<
4646
private static final int DETAIL_LOADER = 0;
4747

4848
private View rootView;
49-
private String dict_Id;
49+
private String dictId;
5050
private DictDb db;
5151
private TextToSpeech tts;
5252
private ProgressDialog progress;
@@ -64,7 +64,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
6464
Bundle savedInstanceState) {
6565
Bundle arguments = getArguments();
6666
if (arguments != null) {
67-
dict_Id = arguments.getString(Intent.EXTRA_TEXT);
67+
dictId = arguments.getString(Intent.EXTRA_TEXT);
6868
}
6969
rootView = inflater.inflate(R.layout.fragment_detail_dict, container, false);
7070

@@ -121,14 +121,14 @@ public void onActivityCreated(Bundle savedInstanceState) {
121121

122122
@Override
123123
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
124-
if (null != dict_Id) {
124+
if (null != dictId) {
125125
switch (id) {
126126
case DETAIL_LOADER:
127127

128128
return new CursorLoader(getActivity(), null, Constants.DICT_COLUMNS, null, null, null) {
129129
@Override
130130
public Cursor loadInBackground() {
131-
return db.getDictCursorById(Integer.parseInt(dict_Id));
131+
return db.getDictCursorById(Integer.parseInt(dictId));
132132
}
133133
};
134134
default: //do nothing
@@ -171,11 +171,11 @@ public void onClick(View v) {
171171
rootView.findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() {
172172
@Override
173173
public void onClick(View v) {
174-
String passage_usr = passageText.getText().toString();
174+
String passageUsr = passageText.getText().toString();
175175

176176
Bundle arguments = new Bundle();
177-
arguments.putString(Intent.EXTRA_TEXT, String.valueOf(dict_Id));
178-
arguments.putString(Constants.passage, passage_usr);
177+
arguments.putString(Intent.EXTRA_TEXT, String.valueOf(dictId));
178+
arguments.putString(Constants.passage, passageUsr);
179179

180180
Fragment frag = ResultActivityFragment.newInstance();
181181
frag.setArguments(arguments);

source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/ResultActivityFragment.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class ResultActivityFragment extends Fragment implements LoaderCallbacks<
4242
private final ContentValues dictValues;
4343

4444
private View rootView;
45-
private String dict_Id;
45+
private String dictId;
4646
private String passageEntered;
4747
private DictDb db;
4848

@@ -60,7 +60,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
6060
Bundle savedInstanceState) {
6161
Bundle arguments = getArguments();
6262
if (arguments != null) {
63-
dict_Id = arguments.getString(Intent.EXTRA_TEXT);
63+
dictId = arguments.getString(Intent.EXTRA_TEXT);
6464
passageEntered = arguments.getString(Constants.passage);
6565
}
6666
rootView = inflater.inflate(R.layout.fragment_result_dict, container, false);
@@ -116,14 +116,14 @@ public void onActivityCreated(Bundle savedInstanceState) {
116116

117117
@Override
118118
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
119-
if (null != dict_Id) {
119+
if (null != dictId) {
120120
switch (id) {
121121
case DETAIL_LOADER:
122122

123123
return new CursorLoader(getActivity(), null, Constants.DICT_COLUMNS, null, null, null) {
124124
@Override
125125
public Cursor loadInBackground() {
126-
return db.getDictCursorById(Integer.parseInt(dict_Id));
126+
return db.getDictCursorById(Integer.parseInt(dictId));
127127
}
128128
};
129129
default: //do nothing
@@ -160,7 +160,7 @@ public void onClick(View v) {
160160
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
161161

162162
Bundle arguments = new Bundle();
163-
arguments.putString(Intent.EXTRA_TEXT, dict_Id);
163+
arguments.putString(Intent.EXTRA_TEXT, dictId);
164164

165165
Fragment frag = org.buildmlearn.toolkit.dictationtemplate.fragment.DetailActivityFragment.newInstance();
166166
frag.setArguments(arguments);

source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/SplashFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
3939
final Activity mActivity = getActivity();
4040
final String result[] = DataUtils.readTitleAuthor();
4141
TextView title = (TextView) rootView.findViewById(R.id.title);
42-
TextView author_name = (TextView) rootView.findViewById(R.id.author_name);
42+
TextView authorName = (TextView) rootView.findViewById(R.id.author_name);
4343

4444
title.setText(result[0]);
45-
author_name.setText(result[1]);
45+
authorName.setText(result[1]);
4646
((TextViewPlus) rootView.findViewById(R.id.intro_text)).setText(getResources().getString(R.string.dictation_title));
4747

4848
rootView.findViewById(R.id.enter).setOnClickListener(new View.OnClickListener() {

source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/MainFragment.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ public boolean onMenuItemClick(MenuItem item) {
144144
mi.setTitle(mi.getTitle());
145145

146146

147-
Cursor flash_cursor = db.getFlashCursorById(Integer.parseInt(FlashId));
148-
flash_cursor.moveToFirst();
149-
String question = flash_cursor.getString(Constants.COL_QUESTION);
150-
String answer = flash_cursor.getString(Constants.COL_ANSWER);
151-
String hint = flash_cursor.getString(Constants.COL_HINT);
152-
String base64 = flash_cursor.getString(Constants.COL_BASE64);
147+
Cursor flashCursor = db.getFlashCursorById(Integer.parseInt(FlashId));
148+
flashCursor.moveToFirst();
149+
String question = flashCursor.getString(Constants.COL_QUESTION);
150+
String answer = flashCursor.getString(Constants.COL_ANSWER);
151+
String hint = flashCursor.getString(Constants.COL_HINT);
152+
String base64 = flashCursor.getString(Constants.COL_BASE64);
153153

154154
assert rootView.findViewById(R.id.intro_number) != null;
155155
((TextView) rootView.findViewById(R.id.intro_number)).setText(String.format(Locale.ENGLISH, "Card #%d of %d", Integer.parseInt(FlashId), numFlash));

source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/SplashFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
3939
final Activity mActivity = getActivity();
4040
final String result[] = DataUtils.readTitleAuthor();
4141
TextView title = (TextView) rootView.findViewById(R.id.title);
42-
TextView author_name = (TextView) rootView.findViewById(R.id.author_name);
42+
TextView authorName = (TextView) rootView.findViewById(R.id.author_name);
4343

4444
title.setText(result[0]);
45-
author_name.setText(result[1]);
45+
authorName.setText(result[1]);
4646
((TextViewPlus) rootView.findViewById(R.id.intro_text)).setText(getResources().getString(R.string.main_title_flash));
4747

4848
rootView.findViewById(R.id.enter).setOnClickListener(new View.OnClickListener() {

source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/SettingsFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public boolean onPreferenceClick(Preference preference) {
7474
}
7575
});
7676

77-
Preference rate_preference=findPreference(getString(R.string.pref_rate_key));
78-
rate_preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
77+
Preference ratePreference=findPreference(getString(R.string.pref_rate_key));
78+
ratePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
7979
@Override
8080
public boolean onPreferenceClick(Preference preference) {
8181
if(NetworkUtils.isNetworkAvailable(getActivity()))

0 commit comments

Comments
 (0)