change identity drawer

This commit is contained in:
Kasun 2019-12-18 18:19:39 +05:30
parent 060be00dd5
commit 2a88be9f38
3 changed files with 54 additions and 46 deletions

View File

@ -18,7 +18,7 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.constraintlayout.widget.ConstraintLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
@ -61,11 +61,10 @@ public class IdentityProofsAdapter extends RecyclerView.Adapter {
holder.proof_name.setOnClickListener(v -> {
Helper.openBrowser(context, identityProof.getProfile_url());
});
holder.proof_name_network.setText(context.getString(R.string.verified_by, identityProof.getProvider()));
holder.proof_name_network.setText(context.getString(R.string.verified_by, identityProof.getProvider(),Helper.shortDateToString(identityProof.getUpdated_at())));
holder.proof_container.setOnClickListener(v -> {
Helper.openBrowser(context, identityProof.getProof_url());
});
holder.proof_date.setText(Helper.shortDateToString(identityProof.getUpdated_at()));
}
@Override
@ -79,15 +78,14 @@ public class IdentityProofsAdapter extends RecyclerView.Adapter {
}
class ViewHolder extends RecyclerView.ViewHolder {
private TextView proof_name, proof_name_network, proof_date;
private LinearLayout proof_container;
private TextView proof_name, proof_name_network;
private ConstraintLayout proof_container;
public ViewHolder(@NonNull View itemView) {
super(itemView);
proof_name = itemView.findViewById(R.id.proof_name);
proof_name_network = itemView.findViewById(R.id.proof_name_network);
proof_container = itemView.findViewById(R.id.proof_container);
proof_date = itemView.findViewById(R.id.proof_date);
}
}

View File

@ -14,50 +14,60 @@
You should have received a copy of the GNU General Public License along with Fedilab; if not,
see <http://www.gnu.org/licenses>.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/proof_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_margin="4dp"
android:background="@drawable/green_border"
android:padding="5dp">
<ImageView
android:layout_margin="10dp"
android:id="@+id/proof_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:contentDescription="@string/verified_user"
android:src="@drawable/ic_verified_user"
android:contentDescription="@string/verified_user" />
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_marginStart="10dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/proof_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/proof_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/proof_name_network"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:layout_marginTop="10dp"
android:id="@+id/proof_date"
android:textStyle="italic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
/>
</LinearLayout>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/proof_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:ellipsize="end"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@id/proof_name_network"
app:layout_constraintEnd_toStartOf="@id/proof_arrow"
app:layout_constraintStart_toEndOf="@id/proof_icon"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/proof_name_network"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:ellipsize="end"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/proof_arrow"
app:layout_constraintStart_toEndOf="@id/proof_icon"
app:layout_constraintTop_toBottomOf="@id/proof_name" />
<ImageView
android:id="@+id/proof_arrow"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/ic_keyboard_arrow_right"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1210,5 +1210,5 @@
<string name="list_of_twitter_accounts">Twitter usernames space separated</string>
<string name="identity_proofs">Identity proofs</string>
<string name="verified_user">Verified identity</string>
<string name="verified_by">Verified by %1$s</string>
<string name="verified_by">Verified by %1$s (%2$s)</string>
</resources>