diff --git a/.gitignore b/.gitignore
index 9c4de58..4535beb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,33 @@
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
+# svn
+*.svn*
+# built application files
+*.apk
+*.ap_
+# files for the dex VM
+*.dex
+# Java class files
+*.class
+# generated GUI files
+*/R.java
+# generated folder
+bin
+gen
+# local
+local.properties
+proguard_logs/
+# log files
+log*.txt
+# archives
+*.gz
+*.tar
+*.zip
+# eclipse
+*.metadata
+*.settings
+*.prefs
+#idea
+*.idea
+*.iml
+out/
+build/
+.gradle/
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
index 796b96d..4535beb 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -1 +1,33 @@
-/build
+# svn
+*.svn*
+# built application files
+*.apk
+*.ap_
+# files for the dex VM
+*.dex
+# Java class files
+*.class
+# generated GUI files
+*/R.java
+# generated folder
+bin
+gen
+# local
+local.properties
+proguard_logs/
+# log files
+log*.txt
+# archives
+*.gz
+*.tar
+*.zip
+# eclipse
+*.metadata
+*.settings
+*.prefs
+#idea
+*.idea
+*.iml
+out/
+build/
+.gradle/
\ No newline at end of file
diff --git a/app/src/main/java/com/performance/ua/performancelab/BackgroundsActivity.java b/app/src/main/java/com/performance/ua/performancelab/BackgroundsActivity.java
index e266125..74ad037 100644
--- a/app/src/main/java/com/performance/ua/performancelab/BackgroundsActivity.java
+++ b/app/src/main/java/com/performance/ua/performancelab/BackgroundsActivity.java
@@ -21,7 +21,9 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.backgrounds_layout);
ListView lv = (ListView) findViewById(R.id.backgrounds_list);
- lv.setAdapter(new BackgroundListAdapter(this, 0, Arrays.asList(new String[]{"title1", "title2", "title3"})));
+ if (lv != null) {
+ lv.setAdapter(new BackgroundListAdapter(this, 0, Arrays.asList("title1", "title2", "title3")));
+ }
}
}
diff --git a/app/src/main/java/com/performance/ua/performancelab/CanvasApiView.java b/app/src/main/java/com/performance/ua/performancelab/CanvasApiView.java
index df5c55d..8bc485d 100644
--- a/app/src/main/java/com/performance/ua/performancelab/CanvasApiView.java
+++ b/app/src/main/java/com/performance/ua/performancelab/CanvasApiView.java
@@ -33,10 +33,15 @@ public CanvasApiView(Context context, AttributeSet attrs, int defStyleAttr) {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
for (int i = 0; i < N; i++) {
+ canvas.save();
+ if (i != N - 1) {
+ canvas.clipRect(MARGIN + i * shift, MARGIN, MARGIN + i * shift + shift, SIZE);
+ }
// Each card is laid out a little to the right of the previous one.
myPaint.setColor(Color.RED / (i + 1));
myPaint.setStrokeWidth(10);
canvas.drawRect(MARGIN + i * shift, MARGIN, SIZE + i * shift, SIZE, myPaint);
+ canvas.restore();
}
// Invalidate the whole view. Doing this calls onDraw() if the view is visible.
invalidate();
diff --git a/app/src/main/res/layout/backgrounds_layout.xml b/app/src/main/res/layout/backgrounds_layout.xml
index 031a411..d36753e 100644
--- a/app/src/main/res/layout/backgrounds_layout.xml
+++ b/app/src/main/res/layout/backgrounds_layout.xml
@@ -2,18 +2,18 @@
+ >
+ />
+ />
\ No newline at end of file
diff --git a/app/src/main/res/layout/canvas_layout.xml b/app/src/main/res/layout/canvas_layout.xml
index 3e480b0..515f9c3 100644
--- a/app/src/main/res/layout/canvas_layout.xml
+++ b/app/src/main/res/layout/canvas_layout.xml
@@ -1,10 +1,5 @@
-
-
-
-
-
\ No newline at end of file
+
diff --git a/app/src/main/res/layout/hierarchy_layout.xml b/app/src/main/res/layout/hierarchy_layout.xml
index 94440c0..837a65b 100644
--- a/app/src/main/res/layout/hierarchy_layout.xml
+++ b/app/src/main/res/layout/hierarchy_layout.xml
@@ -1,38 +1,30 @@
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/activity_vertical_margin"
+ android:orientation="horizontal">
-
-
+
+
-
-
+ android:orientation="vertical">
-
-
-
+ android:text="@string/line1_text"/>
-
-
+
-
\ No newline at end of file