mirror of
https://codeberg.org/Mercury-IM/Mercury-IM
synced 2025-09-10 10:49:41 +02:00
temp
This commit is contained in:
parent
501402e791
commit
edd72d3616
9 changed files with 46 additions and 15 deletions
|
@ -92,15 +92,15 @@ dependencies {
|
||||||
|
|
||||||
// support libraries
|
// support libraries
|
||||||
implementation "androidx.appcompat:appcompat:$appCompatVersion"
|
implementation "androidx.appcompat:appcompat:$appCompatVersion"
|
||||||
implementation 'com.google.android.material:material:1.0.0'
|
implementation 'com.google.android.material:material:1.1.0-alpha07'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
|
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||||
|
|
||||||
// circular image viewer for avatars
|
// circular image viewer for avatars
|
||||||
implementation 'de.hdodenhof:circleimageview:3.0.0'
|
implementation 'de.hdodenhof:circleimageview:3.0.1'
|
||||||
|
|
||||||
// Android specific classes of Smacks API
|
// Android specific classes of Smacks API
|
||||||
implementation "org.igniterealtime.smack:smack-android-extensions:$smackAndroidExtensionsVersion"
|
implementation "org.igniterealtime.smack:smack-android-extensions:$smackAndroidExtensionsVersion"
|
||||||
|
|
|
@ -13,6 +13,7 @@ import androidx.fragment.app.FragmentTransaction;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
|
import com.google.android.material.badge.BadgeDrawable;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
import com.google.android.material.navigation.NavigationView;
|
import com.google.android.material.navigation.NavigationView;
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
bottomNavigationView.setOnNavigationItemSelectedListener(this::onNavigationItemSelected);
|
bottomNavigationView.setOnNavigationItemSelectedListener(this::onNavigationItemSelected);
|
||||||
|
bottomNavigationView.showBadge(R.id.entry_accounts).setNumber(2);
|
||||||
|
|
||||||
MercuryImApplication.getApplication().getAppComponent().inject(this);
|
MercuryImApplication.getApplication().getAppComponent().inject(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.mercury_im.messenger.ui.chat;
|
package org.mercury_im.messenger.ui.chat;
|
||||||
|
|
||||||
|
import android.util.SparseArray;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -17,6 +18,7 @@ import java.util.List;
|
||||||
public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerViewAdapter.ChatItemViewHolder> {
|
public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerViewAdapter.ChatItemViewHolder> {
|
||||||
|
|
||||||
private List<MessageModel> messages = new ArrayList<>();
|
private List<MessageModel> messages = new ArrayList<>();
|
||||||
|
private SparseArray<Boolean> checkedItems = new SparseArray<>();
|
||||||
|
|
||||||
public ChatRecyclerViewAdapter() {
|
public ChatRecyclerViewAdapter() {
|
||||||
|
|
||||||
|
@ -28,6 +30,14 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setItemChecked(int position, boolean checked) {
|
||||||
|
checkedItems.put(position, checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isItemChecked(int position) {
|
||||||
|
return checkedItems.get(position, false);
|
||||||
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ChatItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ChatItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
|
10
app/src/main/res/color/bottom_bar_colors.xml
Normal file
10
app/src/main/res/color/bottom_bar_colors.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_checked="true"
|
||||||
|
android:color="@color/secondaryColor" />
|
||||||
|
|
||||||
|
<item android:state_checked="false"
|
||||||
|
android:color="@color/secondaryDarkColor" />
|
||||||
|
|
||||||
|
</selector>
|
|
@ -25,9 +25,10 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
app:itemIconTint="?attr/colorAccent"
|
app:itemIconTint="@color/bottom_bar_colors"
|
||||||
app:itemTextColor="?attr/colorAccent"
|
app:itemTextColor="@color/bottom_bar_colors"
|
||||||
app:itemBackground="?attr/colorPrimary"
|
app:itemBackground="?attr/colorPrimary"
|
||||||
|
app:itemRippleColor="@color/secondaryColor"
|
||||||
app:menu="@menu/bottom_menu_main" />
|
app:menu="@menu/bottom_menu_main" />
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -10,11 +10,13 @@
|
||||||
android:id="@+id/chat_avatar"
|
android:id="@+id/chat_avatar"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
tools:src="@tools:sample/avatars"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:layout_marginTop="8dp" />
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/chat_name"
|
android:id="@+id/chat_name"
|
||||||
|
@ -48,4 +50,5 @@
|
||||||
app:layout_constraintTop_toTopOf="@+id/chat_avatar"
|
app:layout_constraintTop_toTopOf="@+id/chat_avatar"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginEnd="8dp" />
|
android:layout_marginEnd="8dp" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,7 +1,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
|
<style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar">
|
||||||
<item name="colorAccent">@color/secondaryColor</item>
|
<item name="colorAccent">@color/secondaryColor</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<item name="android:background">@drawable/bg_msg_single</item>
|
<item name="android:background">@drawable/bg_msg_single</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.Light" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme.Light" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||||
<item name="colorAccent">@color/secondaryColor</item>
|
<item name="colorAccent">@color/secondaryColor</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -17,6 +17,6 @@
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.Light.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
<style name="AppTheme.Light.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light" />
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package org.mercury_im.messenger.core.centers;
|
||||||
|
|
||||||
|
public class ContactCenter {
|
||||||
|
|
||||||
|
}
|
|
@ -70,9 +70,9 @@ ext {
|
||||||
// Other libraries
|
// Other libraries
|
||||||
|
|
||||||
// Architecture Components
|
// Architecture Components
|
||||||
lifecycleVersion = "2.2.0-alpha01"
|
lifecycleVersion = '2.2.0-alpha05'
|
||||||
pagingVersion = "2.1.0"
|
pagingVersion = "2.1.0"
|
||||||
appCompatVersion = "1.1.0-rc01"
|
appCompatVersion = '1.1.0'
|
||||||
|
|
||||||
// Room
|
// Room
|
||||||
roomVersion = "2.1.0"
|
roomVersion = "2.1.0"
|
||||||
|
@ -83,13 +83,13 @@ ext {
|
||||||
rxAndroidVersion = "2.1.1"
|
rxAndroidVersion = "2.1.1"
|
||||||
|
|
||||||
// Dagger 2
|
// Dagger 2
|
||||||
daggerVersion = "2.23.1"
|
daggerVersion = '2.24'
|
||||||
|
|
||||||
// Android Support Library
|
// Android Support Library
|
||||||
supportLibVersion = "28.0.0"
|
supportLibVersion = "28.0.0"
|
||||||
|
|
||||||
// Butter Knife
|
// Butter Knife
|
||||||
butterKnifeVersion = "10.1.0"
|
butterKnifeVersion = '10.2.0'
|
||||||
|
|
||||||
// JUnit
|
// JUnit
|
||||||
junitVersion = "4.12"
|
junitVersion = "4.12"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue