Skip to content

Commit 601ca61

Browse files
committed
refactoring of layout xml
tried to remove warnings in activity_soundrecorder.xml refactored ids
1 parent 2bbc8b1 commit 601ca61

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

catroid/res/layout/activity_soundrecorder.xml

+8-18
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
* GNU Affero General Public License for more details.
2020
*
2121
* You should have received a copy of the GNU Affero General Public License
22-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23-
-->
22+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23+
-->
2424
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
25-
android:id="@+id/SoundrecorderActivityRoot"
25+
android:id="@+id/soundrecorder"
2626
android:layout_width="match_parent"
2727
android:layout_height="match_parent"
2828
android:background="@android:color/white"
@@ -38,26 +38,26 @@
3838
android:textColor="@color/dark_gray" />
3939

4040
<ImageView
41-
android:id="@+id/recordButton"
41+
android:id="@+id/soundrecorder_imageview_record"
4242
android:layout_width="wrap_content"
4343
android:layout_height="80dip"
4444
android:layout_gravity="center_horizontal"
4545
android:background="@android:color/transparent"
4646
android:src="@drawable/ic_record_inactive" />
4747

4848
<TextView
49-
android:id="@+id/recording"
49+
android:id="@+id/soundrecorder_textview_recording_hint"
5050
android:layout_width="match_parent"
5151
android:layout_height="wrap_content"
5252
android:gravity="center"
5353
android:paddingTop="30dip"
5454
android:text="@string/soundrecorder_recording"
5555
android:textColor="#000000"
56-
android:textSize="25dip"
56+
android:textSize="25sp"
5757
android:visibility="invisible" />
5858

5959
<LinearLayout
60-
android:id="@+id/recordLayout"
60+
android:id="@+id/soundrecorder_linearlayout_record"
6161
android:layout_width="fill_parent"
6262
android:layout_height="wrap_content"
6363
android:layout_gravity="center_horizontal"
@@ -71,7 +71,7 @@
7171
android:shadowRadius="4" >
7272

7373
<TextView
74-
android:id="@+id/recordText"
74+
android:id="@+id/soundrecorder_textview_record_start_stop"
7575
android:layout_width="wrap_content"
7676
android:layout_height="wrap_content"
7777
android:layout_gravity="center_vertical"
@@ -80,14 +80,4 @@
8080
android:textStyle="bold" />
8181
</LinearLayout>
8282

83-
<!--
84-
<Button
85-
android:id="@+id/buttonRecord"
86-
android:layout_width="wrap_content"
87-
android:layout_height="wrap_content"
88-
android:layout_gravity="center"
89-
android:drawableLeft="@drawable/ic_record_inactive_button"
90-
android:text="@string/soundrecorder_record_start" />
91-
-->
92-
9383
</LinearLayout>

catroid/src/org/catrobat/catroid/soundrecorder/SoundRecorderActivity.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public void onCreate(Bundle savedInstanceState) {
5959

6060
setContentView(R.layout.activity_soundrecorder);
6161

62-
recordLayout = (LinearLayout) findViewById(R.id.recordLayout);
63-
recordButton = (ImageView) findViewById(R.id.recordButton);
64-
recordText = (TextView) findViewById(R.id.recordText);
65-
recordingIndicationText = (TextView) findViewById(R.id.recording);
62+
recordLayout = (LinearLayout) findViewById(R.id.soundrecorder_linearlayout_record);
63+
recordButton = (ImageView) findViewById(R.id.soundrecorder_imageview_record);
64+
recordText = (TextView) findViewById(R.id.soundrecorder_textview_record_start_stop);
65+
recordingIndicationText = (TextView) findViewById(R.id.soundrecorder_textview_recording_hint);
6666

6767
recordLayout.setOnClickListener(this);
6868
Utils.checkForExternalStorageAvailableAndDisplayErrorIfNot(this);
@@ -75,7 +75,7 @@ public void onCreate(Bundle savedInstanceState) {
7575
protected void onDestroy() {
7676
super.onDestroy();
7777

78-
unbindDrawables(findViewById(R.id.SoundrecorderActivityRoot));
78+
unbindDrawables(findViewById(R.id.soundrecorder));
7979
System.gc();
8080
}
8181

@@ -93,7 +93,7 @@ private void unbindDrawables(View view) {
9393

9494
@Override
9595
public void onClick(View v) {
96-
if (v.getId() == R.id.recordLayout) {
96+
if (v.getId() == R.id.soundrecorder_linearlayout_record) {
9797
if (soundRecorder != null && soundRecorder.isRecording()) {
9898
stopRecording();
9999
finish();

0 commit comments

Comments
 (0)