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.9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
RooyeKhat committed Sep 10, 2018
1 parent 856139f commit 9db0ddd
Show file tree
Hide file tree
Showing 35 changed files with 1,613 additions and 765 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
applicationId "net.iGap"
minSdkVersion 15
targetSdkVersion 27
versionCode 79
versionName "0.9.5"
versionCode 80
versionName "0.9.6"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -147,6 +147,7 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
}

configurations.all {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
<activity
android:name=".activities.ActivityCustomError"
android:configChanges="keyboard|keyboardHidden|screenSize|locale"
android:process=":error_activity">
>
<intent-filter>
<action android:name="cat.ereza.customactivityoncrash.ERROR" />
</intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/net/iGap/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Config {

public static final int ACCEPT = 1;
public static final int REJECT = 0;
public static final int REALM_SCHEMA_VERSION = 22;
public static final int REALM_SCHEMA_VERSION = 23;
public static final int REALM_LATEST_MIGRATION_VERSION = REALM_SCHEMA_VERSION - 1;
public static final int LOOKUP_MAP_RESPONSE_OFFSET = 30000;
public static final int MAX_TEXT_ATTACHMENT_LENGTH = 200;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/net/iGap/G.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.support.multidex.MultiDexApplication;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;

import com.crashlytics.android.Crashlytics;
Expand Down Expand Up @@ -97,6 +96,7 @@ public class G extends MultiDexApplication {
public static ArrayList<String> waitingActionIds = new ArrayList<>();
public static ArrayList<String> generalImmovableClasses = new ArrayList<>();
public static ArrayList<Integer> forcePriorityActionId = new ArrayList<>();
public static ArrayList<Integer> ignoreErrorCodes = new ArrayList<>();
public static HashMap<Integer, String> lookupMap = new HashMap<>();
public static HashMap<String, ArrayList<Object>> requestQueueRelationMap = new HashMap<>();
public static HashMap<Integer, Integer> priorityActionId = new HashMap<>();
Expand Down
33 changes: 32 additions & 1 deletion app/src/main/java/net/iGap/activities/ActivityEnterPassCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@
* All rights reserved.
*/

import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.databinding.ObservableField;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.andrognito.patternlockview.PatternLockView;
import com.andrognito.patternlockview.utils.ResourceUtils;

import net.iGap.G;
import net.iGap.R;
import net.iGap.databinding.ActivityEnterPassCodeBinding;
import net.iGap.module.SHP_SETTING;
import net.iGap.viewmodel.ActivityEnterPassCodeViewModel;

public class ActivityEnterPassCode extends ActivityEnhanced {
Expand All @@ -26,8 +36,29 @@ public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
ActivityEnterPassCodeBinding activityEnterPassCodeBinding = DataBindingUtil.setContentView(this, R.layout.activity_enter_pass_code);
activityManageSpaceViewModel = new ActivityEnterPassCodeViewModel(this, activityEnterPassCodeBinding.getRoot());
activityManageSpaceViewModel = new ActivityEnterPassCodeViewModel(this, activityEnterPassCodeBinding);

activityEnterPassCodeBinding.setActivityEnterPassCodeViewModel(activityManageSpaceViewModel);
SharedPreferences sharedPreferences = G.currentActivity.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
boolean isLinePattern = sharedPreferences.getBoolean(SHP_SETTING.KEY_PATTERN_TACTILE_DRAWN, true);

activityEnterPassCodeBinding.patternLockView.setViewMode(PatternLockView.PatternViewMode.CORRECT); // Set the current viee more
activityEnterPassCodeBinding.patternLockView.setInStealthMode(!isLinePattern); // Set the pattern in stealth mode (pattern drawing is hidden)
activityEnterPassCodeBinding.patternLockView.setTactileFeedbackEnabled(true); // Enables vibration feedback when the pattern is drawn
activityEnterPassCodeBinding.patternLockView.setInputEnabled(true); // Disables any input from the pattern lock view completely

activityEnterPassCodeBinding.patternLockView.setDotCount(4);
activityEnterPassCodeBinding.patternLockView.setDotNormalSize((int) ResourceUtils.getDimensionInPx(G.currentActivity, R.dimen.dp22));
activityEnterPassCodeBinding.patternLockView.setDotSelectedSize((int) ResourceUtils.getDimensionInPx(G.currentActivity, R.dimen.dp32));
activityEnterPassCodeBinding.patternLockView.setPathWidth((int) ResourceUtils.getDimensionInPx(G.currentActivity, R.dimen.pattern_lock_path_width));
activityEnterPassCodeBinding.patternLockView.setAspectRatioEnabled(true);
activityEnterPassCodeBinding.patternLockView.setAspectRatio(PatternLockView.AspectRatio.ASPECT_RATIO_HEIGHT_BIAS);
activityEnterPassCodeBinding.patternLockView.setNormalStateColor(ResourceUtils.getColor(G.currentActivity, R.color.white));
activityEnterPassCodeBinding.patternLockView.setCorrectStateColor(ResourceUtils.getColor(G.currentActivity, R.color.white));
activityEnterPassCodeBinding.patternLockView.setWrongStateColor(ResourceUtils.getColor(G.currentActivity, R.color.red));
activityEnterPassCodeBinding.patternLockView.setDotAnimationDuration(150);
activityEnterPassCodeBinding.patternLockView.setPathEndAnimationDuration(100);

}

@Override
Expand Down
102 changes: 74 additions & 28 deletions app/src/main/java/net/iGap/adapter/items/chat/ViewMaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -1931,36 +1931,82 @@ public static View getViewRegisteredContacts() {
ViewGroup.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
swipeRevealLayout.setLayoutParams(layoutParams);

RelativeLayout LinearLayout = new RelativeLayout(G.context);
LinearLayout.setBackgroundColor(G.context.getResources().getColor(R.color.red_swipe));
LinearLayout swipeLayout = new LinearLayout(G.context);
swipeLayout.setOrientation(HORIZONTAL);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
LinearLayout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
swipeLayout.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
}
RelativeLayout.LayoutParams layoutParams1 = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
LinearLayout.setLayoutParams(layoutParams1);

TextView textView = new TextView(G.context);
textView.setText(G.context.getResources().getString(R.string.to_delete_contact));
textView.setGravity(Gravity.CENTER);
setTypeFace(textView);
textView.setTextColor(G.context.getResources().getColor(R.color.white));

ViewGroup.LayoutParams layoutParams2 = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
textView.setLayoutParams(layoutParams2);

MaterialDesignTextView fcsl_txt_icon = new MaterialDesignTextView(G.context);
fcsl_txt_icon.setGravity(CENTER_VERTICAL);
fcsl_txt_icon.setText(G.fragmentActivity.getResources().getString(R.string.md_rubbish_delete_file));
fcsl_txt_icon.setTextColor(G.context.getResources().getColor(R.color.white));
setTextSize(fcsl_txt_icon, R.dimen.dp22);
LinearLayout.LayoutParams layout_178 = new LinearLayout.LayoutParams(i_Dp(R.dimen.dp52), ViewGroup.LayoutParams.MATCH_PARENT);
layout_178.gravity = Gravity.LEFT;
layout_178.leftMargin = i_Dp(R.dimen.dp32);
fcsl_txt_icon.setLayoutParams(layout_178);

LinearLayout.addView(fcsl_txt_icon);
LinearLayout.addView(textView);
swipeRevealLayout.addView(LinearLayout);
LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
swipeLayout.setLayoutParams(layoutParams1);



LinearLayout layoutDelete = new LinearLayout(G.context);
layoutDelete.setId(R.id.swipeDelete);
layoutDelete.setBackgroundColor(G.context.getResources().getColor(R.color.red_swipe));
layoutDelete.setOrientation(HORIZONTAL);
LinearLayout.LayoutParams layoutDeleteParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
layoutDelete.setLayoutParams(layoutDeleteParams);

TextView txtDelete = new TextView(G.context);
txtDelete.setText(G.context.getResources().getString(R.string.delete_item_dialog));
txtDelete.setGravity(Gravity.CENTER);
setTypeFace(txtDelete);

txtDelete.setPadding(20,0,20,0);
txtDelete.setTextColor(G.context.getResources().getColor(R.color.white));
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
txtDelete.setLayoutParams(layoutParams2);

MaterialDesignTextView iconDelete = new MaterialDesignTextView(G.context);
iconDelete.setGravity(CENTER_VERTICAL);
iconDelete.setText(G.fragmentActivity.getResources().getString(R.string.md_rubbish_delete_file));
iconDelete.setTextColor(G.context.getResources().getColor(R.color.white));
iconDelete.setPadding(10,0,10,0);
setTextSize(iconDelete, R.dimen.dp22);
LinearLayout.LayoutParams layout_178 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
// layout_178.gravity = Gravity.LEFT;
// layout_178.leftMargin = i_Dp(R.dimen.dp32);
iconDelete.setLayoutParams(layout_178);

layoutDelete.addView(iconDelete);
layoutDelete.addView(txtDelete);

LinearLayout layoutEdit = new LinearLayout(G.context);
layoutEdit.setId(R.id.swipeEdit);
layoutEdit.setBackgroundColor(G.context.getResources().getColor(R.color.green));
layoutEdit.setOrientation(HORIZONTAL);
LinearLayout.LayoutParams layoutEditParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
layoutEdit.setLayoutParams(layoutEditParams);


TextView txtEdit = new TextView(G.context);
txtEdit.setText(G.context.getResources().getString(R.string.edit));
txtEdit.setGravity(Gravity.CENTER);
setTypeFace(txtEdit);
txtEdit.setPadding(20,0,20,0);

txtEdit.setTextColor(G.context.getResources().getColor(R.color.white));
ViewGroup.LayoutParams layoutParamsEdit = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
txtEdit.setLayoutParams(layoutParamsEdit);

MaterialDesignTextView iconEdit = new MaterialDesignTextView(G.context);
iconEdit.setGravity(CENTER_VERTICAL);
iconEdit.setText(G.fragmentActivity.getResources().getString(R.string.md_edit));
iconEdit.setTextColor(G.context.getResources().getColor(R.color.white));
iconEdit.setPadding(10,0,10,0);
setTextSize(iconEdit, R.dimen.dp22);
LinearLayout.LayoutParams iconEditParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT);
// iconEditParams.gravity = Gravity.LEFT;
iconEdit.setLayoutParams(iconEditParams);

layoutEdit.addView(iconEdit);
layoutEdit.addView(txtEdit);


swipeLayout.addView(layoutDelete);
swipeLayout.addView(layoutEdit);
swipeRevealLayout.addView(swipeLayout);

LinearLayout linearLayout_578 = new LinearLayout(G.context);
// linearLayout_578.setId(R.id.rootRegisterContact);
Expand Down
50 changes: 49 additions & 1 deletion app/src/main/java/net/iGap/fragments/FragmentPassCode.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
package net.iGap.fragments;

import android.content.SharedPreferences;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.andrognito.patternlockview.PatternLockView;
import com.andrognito.patternlockview.listener.PatternLockViewListener;
import com.andrognito.patternlockview.utils.PatternLockUtils;
import com.andrognito.patternlockview.utils.ResourceUtils;

import net.iGap.G;
import net.iGap.R;
import net.iGap.databinding.FragmentPassCodeBinding;
import net.iGap.module.AppUtils;
import net.iGap.module.SHP_SETTING;
import net.iGap.viewmodel.FragmentPassCodeViewModel;

import java.util.List;

import static android.content.Context.MODE_PRIVATE;


/**
* A simple {@link Fragment} subclass.
Expand All @@ -21,6 +35,9 @@ public class FragmentPassCode extends BaseFragment {

private FragmentPassCodeViewModel fragmentPassCodeViewModel;
private FragmentPassCodeBinding fragmentPassCodeBinding;
private boolean isPattern;



public FragmentPassCode() {
// Required empty public constructor
Expand Down Expand Up @@ -56,10 +73,41 @@ public void onClick(View v) {

}
});

boolean isLinePattern;
if (isPattern){
SharedPreferences sharedPreferences = G.currentActivity.getSharedPreferences(SHP_SETTING.FILE_NAME, MODE_PRIVATE);
isLinePattern = sharedPreferences.getBoolean(SHP_SETTING.KEY_PATTERN_TACTILE_DRAWN, true);
}else {
isLinePattern = true;
}

fragmentPassCodeBinding.patternLockView.setViewMode(PatternLockView.PatternViewMode.WRONG); // Set the current viee more
fragmentPassCodeBinding.patternLockView.setInStealthMode(!isLinePattern); // Set the pattern in stealth mode (pattern drawing is hidden)
fragmentPassCodeBinding.patternLockView.setTactileFeedbackEnabled(true); // Enables vibration feedback when the pattern is drawn
fragmentPassCodeBinding.patternLockView.setInputEnabled(true); // Disables any input from the pattern lock view completely

fragmentPassCodeBinding.patternLockView.setDotCount(4);
fragmentPassCodeBinding.patternLockView.setDotNormalSize((int) ResourceUtils.getDimensionInPx(G.fragmentActivity, R.dimen.dp22));
fragmentPassCodeBinding.patternLockView.setDotSelectedSize((int) ResourceUtils.getDimensionInPx(G.fragmentActivity, R.dimen.dp32));
fragmentPassCodeBinding.patternLockView.setPathWidth((int) ResourceUtils.getDimensionInPx(G.fragmentActivity, R.dimen.pattern_lock_path_width));
fragmentPassCodeBinding.patternLockView.setAspectRatioEnabled(true);
fragmentPassCodeBinding.patternLockView.setAspectRatio(PatternLockView.AspectRatio.ASPECT_RATIO_HEIGHT_BIAS);
if (G.isDarkTheme) {
fragmentPassCodeBinding.patternLockView.setNormalStateColor(ResourceUtils.getColor(G.fragmentActivity, R.color.white));
}else {
fragmentPassCodeBinding.patternLockView.setNormalStateColor(Color.parseColor(G.appBarColor));
}
fragmentPassCodeBinding.patternLockView.setCorrectStateColor(ResourceUtils.getColor(G.fragmentActivity, R.color.green));
fragmentPassCodeBinding.patternLockView.setWrongStateColor(ResourceUtils.getColor(G.fragmentActivity, R.color.red));
fragmentPassCodeBinding.patternLockView.setDotAnimationDuration(150);
fragmentPassCodeBinding.patternLockView.setPathEndAnimationDuration(100);

}

private void initDataBinding() {
fragmentPassCodeViewModel = new FragmentPassCodeViewModel();
fragmentPassCodeViewModel = new FragmentPassCodeViewModel(fragmentPassCodeBinding);
isPattern = fragmentPassCodeViewModel.isPattern;
fragmentPassCodeBinding.setFragmentPassCodeViewModel(fragmentPassCodeViewModel);
}

Expand Down
Loading

0 comments on commit 9db0ddd

Please sign in to comment.