Fixed bug related with crash app (null on error views)

This commit is contained in:
ChronosX88 2019-01-27 21:52:09 +04:00
parent 3b92ca5bd6
commit e62ddd8e59
No known key found for this signature in database
GPG Key ID: 8F92E090A87804AA
3 changed files with 11 additions and 8 deletions

View File

@ -68,6 +68,9 @@ public class MainActivity extends AppCompatActivity
mSwipeRefreshLayout.setOnRefreshListener(MainActivity.this); mSwipeRefreshLayout.setOnRefreshListener(MainActivity.this);
mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); mSwipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
mErrorTextView = findViewById(R.id.errorTextView);
mConnectionErrorImageView = findViewById(R.id.connectionErrorImageView);
mPresenter = new MainPresenter(this, MainActivity.this); mPresenter = new MainPresenter(this, MainActivity.this);
treeView = new TreeView(rootNode, MainActivity.this, new NodeViewFactory(MainActivity.this, this, this.mPresenter.getCoreModel())); treeView = new TreeView(rootNode, MainActivity.this, new NodeViewFactory(MainActivity.this, this, this.mPresenter.getCoreModel()));

View File

@ -22,20 +22,20 @@
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
<ImageView <ImageView
android:id="@+id/connectionErrorImageView" android:id="@+id/searchableConnectionErrorImageView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="70dp" android:layout_marginTop="70dp"
android:layout_marginBottom="52dp" android:layout_marginBottom="52dp"
android:src="@drawable/ic_cloud_off_gray_24dp" android:src="@drawable/ic_cloud_off_gray_24dp"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@+id/errorTextView" app:layout_constraintBottom_toTopOf="@+id/searchableErrorTextView"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/errorTextView" android:id="@+id/searchableErrorTextView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="77dp" android:layout_height="77dp"
android:layout_marginStart="9dp" android:layout_marginStart="9dp"
@ -47,7 +47,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/connectionErrorImageView" /> app:layout_constraintTop_toBottomOf="@+id/searchableConnectionErrorImageView" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>

View File

@ -30,20 +30,20 @@
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>
<ImageView <ImageView
android:id="@+id/searchableConnectionErrorImageView" android:id="@+id/connectionErrorImageView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginTop="70dp" android:layout_marginTop="70dp"
android:layout_marginBottom="52dp" android:layout_marginBottom="52dp"
android:src="@drawable/ic_cloud_off_gray_24dp" android:src="@drawable/ic_cloud_off_gray_24dp"
android:visibility="invisible" android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@+id/searchableErrorTextView" app:layout_constraintBottom_toTopOf="@+id/errorTextView"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/searchableErrorTextView" android:id="@+id/errorTextView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="77dp" android:layout_height="77dp"
android:layout_marginStart="9dp" android:layout_marginStart="9dp"
@ -55,7 +55,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/searchableConnectionErrorImageView" /> app:layout_constraintTop_toBottomOf="@+id/connectionErrorImageView" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>