Skip to content

Commit

Permalink
version 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Apr 18, 2019
1 parent d48dda5 commit 3095963
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 36 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
3 changes: 1 addition & 2 deletions UniTools.iml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ android {
applicationId "com.github.ali77gh.unitools"
minSdkVersion 19
targetSdkVersion 28
versionName '1.6.1'
versionName '1.7.0'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 3
versionCode 4
}
buildTypes {
release {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
20 changes: 1 addition & 19 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
[
{
"outputType": {
"type": "APK"
},
"apkInfo": {
"type": "MAIN",
"splits": [],
"versionCode": 3,
"versionName": "1.6.1",
"enabled": true,
"outputFile": "app-release.apk",
"fullName": "release",
"baseName": "release"
},
"path": "app-release.apk",
"properties": {}
}
]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"1.7.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
103 changes: 103 additions & 0 deletions app/src/main/analyze.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/usr/bin/python3
# i write all codes on 1 file because its easy to move for users ;)

from fnmatch import filter
import os
import sys


def ShowHelp():
print()
print(" " + 62 * "-")
print("| ProjectAnalyzer |")
print("| |")
print("| github:https://github.com/ali77gh/ProjectAnalyzer |")
print("| |")
print("| how to use : |")
print("| > python3 analyze.py 'postfix' |")
print("| > python3 analyze.py 'postfix' --ignore 'dir or files names'|")
print(" " + 62 * "-")
print()


def ShowInBox(str):
print("| " + str + ((51-len(str)) * " ") + "|")


def Line():
print(" " + 52 * "-")


def getFileList(path, filePostfix):
array = []
file_name = "*."+filePostfix
for root, dirs, files in os.walk(path):
for filename in filter(files, file_name):
array.append(os.path.join(root, filename))
return array


def getLineNumbers(Files):
lines = 0
for i in Files:
lines += sum(1 for line in open(i))
return lines



def RemoveIgnores(allFiles, ignores):
for i in allFiles:
for j in ignores:
if i.find(j)>0:
allFiles.remove(i)


def ValidateInputs():
firstMode = len(sys.argv) == 2 and (not sys.argv[1] == "--ignore")
secondMode = len(sys.argv) > 3 and sys.argv[2] == "--ignore"
if (not firstMode) and (not secondMode):
print("bad way to use")
ShowHelp()
exit(0)

# main
if len(sys.argv) == 1 or sys.argv[1] == "--help" :
ShowHelp()
exit(0)

ValidateInputs()

ignores = []
if len(sys.argv) > 3 and sys.argv[2] == "--ignore":
ignores = sys.argv[3:]

postfix = sys.argv[1]

Line()
ShowInBox(" ProjectAnalyzer")
ShowInBox("")
ShowInBox("https://github.com/ali77gh/ProjectAnalyzer")
ShowInBox("")
ShowInBox("searching...")
files = getFileList(os.getcwd(), postfix)
RemoveIgnores(files, ignores)
if len(files) == 0:
ShowInBox("there is no " + postfix + " file")
Line()
exit()

try:
lines = getLineNumbers(files)
except UnicodeDecodeError as e:
ShowInBox("this file type is not unicode :|")
Line()
exit()

linePerFile = round(lines / len(files), 2)
ShowInBox("you have " + str(len(files)) + " " + postfix + " files")
ShowInBox("you have " + str(lines) + " " + " lines of " + postfix)
ShowInBox("lines per file average: " + str(linePerFile))
ShowInBox("")
Line()

# todo --ignore param
21 changes: 19 additions & 2 deletions app/src/main/java/com/github/ali77gh/unitools/core/Translator.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public static String getUClassReadable(UClass uClass, boolean widget) {
if (diff > 0 & diff < 60) {
toClass = "(" + CH.getString(R.string.started) + ")";
} else if (diff < 0) {
toClass = "(" + String.valueOf(uClass.time.getMins() - DateTimeTools.getCurrentTime().getMins()) + " " + CH.getString(R.string.minute_later) + " )";
} else day = CH.getString(R.string.today);
toClass = "(" + ToNextClassString(uClass.time.getMins() - DateTimeTools.getCurrentTime().getMins()) + " " + CH.getString(R.string.later) + " )";
} else
day = CH.getString(R.string.today);

} else if (DateTimeTools.getCurrentDayOfWeek() + 1 == uClass.time.dayOfWeek | (DateTimeTools.getCurrentDayOfWeek() == 6 & 0 == uClass.time.dayOfWeek)) {
day = CH.getString(R.string.tomorrow);
} else {
Expand Down Expand Up @@ -101,6 +103,21 @@ public static String NumToString(Number s) {
return NumToString(String.valueOf(s));
}

public static String NumToStringClockMode(int value){
if (value < 10)
return "0" + String.valueOf(value);
else
return String.valueOf(value);
}

private static String ToNextClassString(int mins){

final int hour = mins / 60;
final int min = mins % 60;

return NumToStringClockMode(hour) + ":" + NumToStringClockMode(min);
}


public static String getWeekNumberString(int weekNumber) {
if (weekNumber > 38) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void onTextChanged(CharSequence s, int start, int before, int count) {

@Override
public void afterTextChanged(Editable s) {
if (s.toString().equals("")){
editText.setText("0");
return;
}
uClass.reminder = Integer.valueOf(s.toString()) * 60 * 1000;
UClassRepo.Update(uClass);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import android.widget.Toast;

import com.github.ali77gh.unitools.R;
import com.github.ali77gh.unitools.data.model.Event;
import com.github.ali77gh.unitools.data.repo.EventRepo;
import com.github.ali77gh.unitools.data.repo.UserInfoRepo;

import java.util.List;

/**
* Created by ali77gh on 10/27/18.
*/
Expand All @@ -31,6 +35,8 @@ protected void onCreate(Bundle savedInstanceState) {
Button ok = findViewById(R.id.btn_setup_week_counter_dialog_ok);

cancel.setOnClickListener(view -> dismiss());

//load current
int current = UserInfoRepo.getWeekNumber();
if (current < 38)
input.setText(String.valueOf(current));
Expand All @@ -46,10 +52,22 @@ protected void onCreate(Bundle savedInstanceState) {
return;
}
UserInfoRepo.setWeekNumber(selectedWeek);

MoveEvents(selectedWeek - current);

dismiss();
});
}

private void MoveEvents(int moveForward){
List<Event> events = EventRepo.getAll();

for (Event e : events){
e.WeekNumber += moveForward;
EventRepo.Update(e);
}
}

private boolean IsInt(String s) {
try {
int a = Integer.valueOf(s);
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/layout/fragment_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@

</LinearLayout>

<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1px"
android:alpha=".5"
android:background="@color/black" />

<View
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<string name="open_on_website">باز کردن وبسایت</string>
<string name="share_classes">اشتراک گذاری کلاس ها</string>
<string name="started">شروع شده</string>
<string name="minute_later">دقیقه دیگر</string>
<string name="later">مانده تا شروع</string>
<string name="there_is_no_class">کلاسی وجور ندارد</string>
<string name="select_language">زبان را انتخاب کنید</string>
<string name="skip">بلدم</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">UniTools</string>
<string name="app_version">1.6.1</string>
<string name="app_version">1.7.0</string>

<string name="LangID">"en</string>

Expand Down Expand Up @@ -107,7 +107,7 @@
<string name="open_on_website">open website</string>
<string name="share_classes">share classes</string>
<string name="started">started</string>
<string name="minute_later">minute later</string>
<string name="later">later</string>
<string name="there_is_no_class">there is no class</string>
<string name="select_language">select language</string>
<string name="skip">skip</string>
Expand Down
2 changes: 1 addition & 1 deletion pdfwriter/pdfwriter.iml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
2 changes: 1 addition & 1 deletion uneversaldatetools/uneversaldatetools.iml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

0 comments on commit 3095963

Please sign in to comment.