Adds loader to instances.social
This commit is contained in:
parent
4183137863
commit
23539841f6
|
@ -39,6 +39,8 @@ import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +71,8 @@ public class InstanceHealthActivity extends AppCompatActivity {
|
||||||
private InstanceSocial instanceSocial;
|
private InstanceSocial instanceSocial;
|
||||||
private TextView name, values, checked_at, up, uptime;
|
private TextView name, values, checked_at, up, uptime;
|
||||||
private String instance;
|
private String instance;
|
||||||
private LinearLayout container;
|
private LinearLayout container, instance_container;
|
||||||
|
private RelativeLayout loader;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -92,7 +95,8 @@ public class InstanceHealthActivity extends AppCompatActivity {
|
||||||
up = findViewById(R.id.up);
|
up = findViewById(R.id.up);
|
||||||
uptime = findViewById(R.id.uptime);
|
uptime = findViewById(R.id.uptime);
|
||||||
container = findViewById(R.id.container);
|
container = findViewById(R.id.container);
|
||||||
|
instance_container = findViewById(R.id.instance_container);
|
||||||
|
loader = findViewById(R.id.loader);
|
||||||
|
|
||||||
close.setOnClickListener(new View.OnClickListener() {
|
close.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -177,6 +181,8 @@ public class InstanceHealthActivity extends AppCompatActivity {
|
||||||
uptime.setText(String.format("Uptime: %.2f %%", (instanceSocial.getUptime()*100)));
|
uptime.setText(String.format("Uptime: %.2f %%", (instanceSocial.getUptime()*100)));
|
||||||
checked_at.setText(String.format("Checked at: %s", Helper.dateToString(getApplicationContext(), instanceSocial.getChecked_at())));
|
checked_at.setText(String.format("Checked at: %s", Helper.dateToString(getApplicationContext(), instanceSocial.getChecked_at())));
|
||||||
values.setText(String.format("version: %s \n %s users - %s statuses", instanceSocial.getVersion(), withSuffix(instanceSocial.getUsers()), withSuffix(instanceSocial.getStatuses())));
|
values.setText(String.format("version: %s \n %s users - %s statuses", instanceSocial.getVersion(), withSuffix(instanceSocial.getUsers()), withSuffix(instanceSocial.getStatuses())));
|
||||||
|
instance_container.setVisibility(View.VISIBLE);
|
||||||
|
loader.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,74 +10,94 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="300dp">
|
android:layout_height="300dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/name"
|
android:id="@+id/instance_container"
|
||||||
android:textSize="20sp"
|
android:visibility="gone"
|
||||||
android:textColor="@color/titleb"
|
android:orientation="vertical"
|
||||||
android:layout_gravity="center"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/titleb"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/values"
|
||||||
|
android:textColor="@color/dark_text"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:textColor="@color/dark_text"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:id="@+id/checked_at"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/up"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:textColor="@color/dark_text"
|
||||||
|
android:id="@+id/uptime"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:id="@+id/ref_instance"
|
||||||
|
android:layout_gravity="end|center_vertical"
|
||||||
|
android:text="via instances.social"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:id="@+id/close"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:text="@string/close"
|
||||||
|
android:textColor="@color/buttonb"
|
||||||
|
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/loader"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_width="wrap_content"
|
>
|
||||||
android:layout_height="wrap_content" />
|
<ProgressBar
|
||||||
|
android:layout_width="wrap_content"
|
||||||
<TextView
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/values"
|
android:indeterminate="true" />
|
||||||
android:textColor="@color/dark_text"
|
</RelativeLayout>
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:textColor="@color/dark_text"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:id="@+id/checked_at"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/up"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:textColor="@color/dark_text"
|
|
||||||
android:id="@+id/uptime"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:id="@+id/ref_instance"
|
|
||||||
android:layout_gravity="end|center_vertical"
|
|
||||||
android:text="via instances.social"
|
|
||||||
android:layout_marginRight="5dp"
|
|
||||||
android:layout_marginEnd="5dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
tools:ignore="HardcodedText" />
|
|
||||||
<Button
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:id="@+id/close"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:text="@string/close"
|
|
||||||
android:textColor="@color/buttonb"
|
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue