Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Commit

Permalink
Update Matched V 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RooyeKhat committed May 9, 2018
1 parent 05a1e83 commit 5b1544e
Show file tree
Hide file tree
Showing 130 changed files with 1,973 additions and 1,076 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId "net.iGap"
minSdkVersion 15
targetSdkVersion 25
versionCode 60
versionName "0.6.0"
versionCode 61
versionName "0.6.1"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/net/iGap/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Config {
public static final int ACTION_CHECKING = 500;
public static final int GROUP_SHOW_ACTIONS_COUNT = 3;
public static final int LIMIT_GET_HISTORY_LOW = 10;
public static final int LIMIT_GET_HISTORY_NORMAL = 100;
public static final int LIMIT_GET_HISTORY_NORMAL = 50;
public static final int LIMIT_LOAD_ROOM = 50;
public static final int FAST_START_PAGE_TIME = (int) 20;
public static final int LOW_START_PAGE_TIME = (int) 25;
Expand Down Expand Up @@ -82,7 +82,8 @@ public class Config {
public static String default_dark_notificationColor = "#000000";
public static String default_dark_toggleButtonColor = "#000000";
public static String default_dark_attachmentColor = "#000000";
public static String default_dark_headerTextColor = "#111111";
public static String default_dark_menuBackgroundColor = "#000000";
public static String default_dark_headerTextColor = "#ffffff";
public static String default_dark_progressColor = "#ffffff";

}
9 changes: 9 additions & 0 deletions app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ public class G extends MultiDexApplication {
public static String attachmentColor;
public static String progressColor;
public static String headerTextColor;
public static String backgroundTheme;
public static String backgroundTheme_2;
public static String logLineTheme;
public static String voteIconTheme;
public static String textTitleTheme;
public static String textSubTheme;
public static String tintImage;
public static String menuBackgroundColor;
public static String authorHash;
public static String displayName;
public static boolean isAppInFg = false;
Expand Down Expand Up @@ -146,6 +154,7 @@ public class G extends MultiDexApplication {
public static boolean isLandscape = false;
public static boolean isAppRtl = false;
public static boolean isLinkClicked = false;
public static boolean isDarkTheme = false;
public static String selectedTabInMainActivity = "";
public static int ivSize;
public static int userTextSize = 0;
Expand Down
42 changes: 38 additions & 4 deletions app/src/main/java/net/iGap/activities/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.ToggleButton;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.GravityEnum;
Expand Down Expand Up @@ -134,6 +135,7 @@
import net.iGap.request.RequestUserInfo;
import net.iGap.request.RequestUserSessionLogout;
import net.iGap.viewmodel.ActivityCallViewModel;
import net.iGap.viewmodel.FragmentSettingViewModel;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -336,6 +338,10 @@ protected void onNewIntent(Intent intent) {

private void checkIntent(Intent intent) {

if (G.isRestartActivity) {
return;
}

new HelperGetDataFromOtherApp(intent);

Bundle extras = intent.getExtras();
Expand Down Expand Up @@ -365,12 +371,11 @@ private void checkIntent(Intent intent) {
@Override
public void onCreate(Bundle savedInstanceState) {

setTheme(R.style.AppThemeTranslucent);
// setTheme(R.style.AppThemeTranslucent);

if (G.isFirstPassCode) {
openActivityPassCode();
}

//if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
//isNeedToRegister = true; // continue app even don't have storage permission
//isOnGetPermission = true;
Expand Down Expand Up @@ -443,8 +448,12 @@ public void finishActivity() {
editor.apply();
}
}


SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (preferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false)) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
}
setContentView(R.layout.activity_main);

drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
Expand Down Expand Up @@ -1347,6 +1356,7 @@ public void onClick(View v) {
}
});
ViewGroup itemQrCode = (ViewGroup) findViewById(R.id.lm_ll_qrCode);

itemQrCode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand All @@ -1369,6 +1379,30 @@ public void deny() {
closeDrawer();
}
});
final ToggleButton toggleButton = findViewById(R.id.st_txt_st_toggle_theme_dark);
ViewGroup rootDarkTheme = (ViewGroup) findViewById(R.id.lt_txt_st_theme_dark);
rootDarkTheme.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleButton.performClick();
}
});
boolean checkedThemeDark = sharedPreferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false);

toggleButton.setChecked(checkedThemeDark);
toggleButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

SharedPreferences.Editor editor = sharedPreferences.edit();

if (toggleButton.isChecked()) {
FragmentSettingViewModel.setDarkTheme(editor);
} else {
FragmentSettingViewModel.setLightTheme(editor);
}
}
});

ViewGroup itemNavOut = (ViewGroup) findViewById(R.id.lm_ll_igap_faq);
itemNavOut.setOnClickListener(new View.OnClickListener() {
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/net/iGap/activities/ActivityManageSpace.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
package net.iGap.activities;

import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.os.Bundle;

import net.iGap.R;
import net.iGap.databinding.ActivityManageSpaceBinding;
import net.iGap.libs.rippleeffect.RippleView;
import net.iGap.module.SHP_SETTING;
import net.iGap.viewmodel.ActivityManageSpaceViewModel;

import static net.iGap.G.context;

public class ActivityManageSpace extends ActivityEnhanced {

@Override
public void onCreate(Bundle savedInstanceState) {

SharedPreferences preferences = context.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
if (preferences.getBoolean(SHP_SETTING.KEY_THEME_DARK, false)) {
this.setTheme(R.style.Material_blackCustom);
} else {
this.setTheme(R.style.Material_lightCustom);
}

super.onCreate(savedInstanceState);
ActivityManageSpaceBinding activityManageSpaceBinding = DataBindingUtil.setContentView(this, R.layout.activity_manage_space);
ActivityManageSpaceViewModel activityManageSpaceViewModel = new ActivityManageSpaceViewModel(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position)
if (holder.getItemViewType() == ALL) {

final ViewHolderItem holder2 = (ViewHolderItem) holder;
holder2.img.setImageDrawable(null);

if (mList.size() < (position + 1)) {
return;
Expand Down
73 changes: 55 additions & 18 deletions app/src/main/java/net/iGap/adapter/items/chat/AbstractMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public void run() {

TextView txtTime = (TextView) holder.itemView.findViewById(R.id.cslr_txt_time);
if (txtTime != null) {
txtTime.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
txtTime.setTextColor(Color.parseColor(G.textTitleTheme));
txtTime.setText(HelperCalander.getClocktime(mMessage.time, false));

if (HelperCalander.isPersianUnicode) {
Expand Down Expand Up @@ -657,18 +657,26 @@ protected void updateLayoutForReceive(VH holder) {
TextView messageText = (TextView) holder.itemView.findViewById(R.id.messageSenderTextMessage);

if (messageText != null) {
messageText.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
messageText.setTextColor(Color.parseColor(G.textTitleTheme));
}
// ProtoGlobal.RoomMessageType messageType = mMessage.forwardedFrom == null ? mMessage.messageType : mMessage.forwardedFrom.getMessageType();

setTextColor(imgTick, R.color.colorOldBlack);
if (G.isDarkTheme) {
setTextColor(imgTick, R.color.white);
} else {
setTextColor(imgTick, R.color.colorOldBlack);
}


((FrameLayout.LayoutParams) frameLayout.getLayoutParams()).gravity = Gravity.LEFT;

((LinearLayout.LayoutParams) holder.itemView.findViewById(R.id.contentContainer).getLayoutParams()).gravity = Gravity.LEFT;

((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangel_white_round);

if (G.isDarkTheme) {
((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangel_white_round_dark);
} else {
((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangel_white_round);
}

/**
* add main layout margin to prevent getting match parent completely
Expand Down Expand Up @@ -707,7 +715,7 @@ protected void updateLayoutForSend(VH holder) {
// TextView iconHearing = (TextView) holder.itemView.findViewById(R.id.cslr_txt_hearing);

if (messageText != null) {
messageText.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
messageText.setTextColor(Color.parseColor(G.textTitleTheme));
}
// ProtoGlobal.RoomMessageType messageType = mMessage.forwardedFrom == null ? mMessage.messageType : mMessage.forwardedFrom.getMessageType();

Expand All @@ -718,9 +726,18 @@ protected void updateLayoutForSend(VH holder) {
setTextColor(imgTick, R.color.iGapColor);
imgTick.setVisibility(View.VISIBLE);
} else {
setTextColor(imgTick, R.color.colorOldBlack);

if (G.isDarkTheme) {
setTextColor(imgTick, R.color.white);
} else {
setTextColor(imgTick, R.color.colorOldBlack);
}
}
if (G.isDarkTheme) {
((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangle_send_round_color_dark);
} else {
((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangle_send_round_color);
}
((View) (holder.itemView.findViewById(R.id.contentContainer)).getParent()).setBackgroundResource(R.drawable.rectangle_send_round_color);

/**
* add main layout margin to prevent getting match parent completely
Expand Down Expand Up @@ -789,15 +806,33 @@ public void onClick(View v) {
((EmojiTextViewE) replayView.findViewById(R.id.chslr_txt_replay_message)).setText(forwardMessage);

if (mMessage.isSenderMe() && type != ProtoGlobal.Room.Type.CHANNEL) {
replayView.setBackgroundColor(holder.itemView.getResources().getColor(R.color.messageBox_replyBoxBackgroundSend));
if (G.isDarkTheme) {
replayView.setBackgroundColor(Color.parseColor(G.backgroundTheme));
replyFrom.setTextColor(Color.parseColor(G.textTitleTheme));
replayMessage.setTextColor(Color.parseColor(G.textTitleTheme));
} else {
replayView.setBackgroundColor(holder.itemView.getResources().getColor(R.color.messageBox_replyBoxBackgroundSend));
replyFrom.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
replayMessage.setTextColor(holder.itemView.getResources().getColor(R.color.replay_message_text));
}

//holder.itemView.findViewById(R.id.verticalLine).setBackgroundColor(holder.itemView.getContext().getResources().getColor(R.color.messageBox_sendColor));
replyFrom.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
replayMessage.setTextColor(holder.itemView.getResources().getColor(R.color.replay_message_text));

} else {
replayView.setBackgroundColor(holder.itemView.getResources().getColor(R.color.messageBox_replyBoxBackgroundReceive));
// holder.itemView.findViewById(R.id.verticalLine).setBackgroundColor(holder.itemView.getContext().getResources().getColor(R.color.messageBox_receiveColor));
replyFrom.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
replayMessage.setTextColor(holder.itemView.getResources().getColor(R.color.replay_message_text));

if (G.isDarkTheme) {
replayView.setBackgroundColor(Color.parseColor(G.backgroundTheme));
// holder.itemView.findViewById(R.id.verticalLine).setBackgroundColor(holder.itemView.getContext().getResources().getColor(R.color.messageBox_receiveColor));
replyFrom.setTextColor(Color.parseColor(G.textTitleTheme));
replayMessage.setTextColor(Color.parseColor(G.textTitleTheme));
} else {
replayView.setBackgroundColor(holder.itemView.getResources().getColor(R.color.messageBox_replyBoxBackgroundReceive));
// holder.itemView.findViewById(R.id.verticalLine).setBackgroundColor(holder.itemView.getContext().getResources().getColor(R.color.messageBox_receiveColor));
replyFrom.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
replayMessage.setTextColor(holder.itemView.getResources().getColor(R.color.replay_message_text));
}


}

replyFrom.measure(0, 0); //must call measure!
Expand Down Expand Up @@ -889,7 +924,7 @@ public void onClick(View v) {
if (realmRoom != null) {
txtForwardFrom.setText(realmRoom.getTitle());
if (mMessage.isSenderMe()) {
txtForwardFrom.setTextColor(G.context.getResources().getColor(R.color.colorOldBlack));
txtForwardFrom.setTextColor(Color.parseColor(G.textTitleTheme));
} else {
txtForwardFrom.setTextColor(G.context.getResources().getColor(R.color.iGapColor));
}
Expand Down Expand Up @@ -928,7 +963,7 @@ public void onClick(View v) {

txtForwardFrom.setText(realmRoom1.getTitle());
if (mMessage.isSenderMe()) {
txtForwardFrom.setTextColor(G.context.getResources().getColor(R.color.colorOldBlack));
txtForwardFrom.setTextColor(Color.parseColor(G.textTitleTheme));
} else {
txtForwardFrom.setTextColor(G.context.getResources().getColor(R.color.iGapColor));
}
Expand Down Expand Up @@ -1529,7 +1564,9 @@ public void run() {
// }
//}
if (progressBar.getTag() != null && progressBar.getTag().equals(mMessage.messageID) && !(mMessage.status.equals(ProtoGlobal.RoomMessageStatus.FAILED.toString()))) {
progressBar.withProgress(progress);
if (progress >= 1) {
progressBar.withProgress(progress);
}
if (progress == 100) {
progressBar.performProgress();
}
Expand Down
14 changes: 10 additions & 4 deletions app/src/main/java/net/iGap/adapter/items/chat/AudioItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package net.iGap.adapter.items.chat;

import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
Expand Down Expand Up @@ -264,7 +265,12 @@ public boolean onTouch(View v, MotionEvent event) {
}

View audioBoxView = holder.itemView.findViewById(R.id.audioBox);
audioBoxView.setBackgroundResource(R.drawable.green_bg_rounded_corner);
if (G.isDarkTheme) {
audioBoxView.setBackgroundResource(R.drawable.green_bg_rounded_corner_dark);
} else {
audioBoxView.setBackgroundResource(R.drawable.green_bg_rounded_corner);
}


//if ((mMessage.forwardedFrom != null && mMessage.forwardedFrom.getForwardMessage() != null && mMessage.forwardedFrom.getForwardMessage().getMessage() != null && !TextUtils.isEmpty(mMessage.forwardedFrom.getForwardMessage().getMessage())) || !TextUtils.isEmpty(mMessage.messageText)) {
// audioBoxView.setBackgroundResource(R.drawable.green_bg_rounded_corner);
Expand Down Expand Up @@ -309,7 +315,7 @@ protected void updateLayoutForSend(ViewHolder holder) {
holder.musicSeekbar.getThumb().mutate().setColorFilter(G.context.getResources().getColor(R.color.iGapColorDarker), PorterDuff.Mode.SRC_IN);
}
holder.musicSeekbar.getProgressDrawable().setColorFilter(holder.itemView.getResources().getColor(R.color.text_line1_igap_dark), android.graphics.PorterDuff.Mode.SRC_IN);
holder.txt_Timer.setTextColor(holder.itemView.getResources().getColor(R.color.black90));
holder.txt_Timer.setTextColor(Color.parseColor(G.textTitleTheme));
}

@Override
Expand All @@ -321,14 +327,14 @@ protected void updateLayoutForReceive(ViewHolder holder) {
holder.musicSeekbar.getThumb().mutate().setColorFilter(G.context.getResources().getColor(R.color.iGapColorDarker), PorterDuff.Mode.SRC_IN);
}
holder.musicSeekbar.getProgressDrawable().setColorFilter(holder.itemView.getResources().getColor(R.color.text_line1_igap_dark), android.graphics.PorterDuff.Mode.SRC_IN);
holder.txt_Timer.setTextColor(holder.itemView.getResources().getColor(R.color.black90));
holder.txt_Timer.setTextColor(Color.parseColor(G.textTitleTheme));
} else {
if (Build.VERSION.SDK_INT >= JELLY_BEAN) {
holder.musicSeekbar.getThumb().mutate().setColorFilter(G.context.getResources().getColor(R.color.iGapColorDarker), PorterDuff.Mode.SRC_IN);
}
holder.musicSeekbar.getProgressDrawable().setColorFilter(holder.itemView.getResources().getColor(R.color.gray10), android.graphics.PorterDuff.Mode.SRC_IN);
holder.txt_Timer.setTextColor(holder.itemView.getResources().getColor(R.color.grayNewDarker));
holder.fileName.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
holder.fileName.setTextColor(Color.parseColor(G.textSubTheme));
}
}

Expand Down
11 changes: 9 additions & 2 deletions app/src/main/java/net/iGap/adapter/items/chat/FileItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package net.iGap.adapter.items.chat;

import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -115,8 +116,14 @@ protected void updateLayoutForSend(ViewHolder holder) {
@Override
protected void updateLayoutForReceive(ViewHolder holder) {
super.updateLayoutForReceive(holder);
holder.cslf_txt_file_name.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
holder.cslf_txt_file_size.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
if (G.isDarkTheme) {
holder.cslf_txt_file_name.setTextColor(Color.parseColor(G.textTitleTheme));
holder.cslf_txt_file_size.setTextColor(Color.parseColor(G.textSubTheme));
} else {
holder.cslf_txt_file_name.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
holder.cslf_txt_file_size.setTextColor(holder.itemView.getResources().getColor(R.color.colorOldBlack));
}

}

@Override
Expand Down
Loading

0 comments on commit 5b1544e

Please sign in to comment.