@ -0,0 +1 @@ |
|||
/build |
@ -0,0 +1,128 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="TSTU" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> |
|||
<component name="FacetManager"> |
|||
<facet type="android-gradle" name="Android-Gradle"> |
|||
<configuration> |
|||
<option name="GRADLE_PROJECT_PATH" value=":app" /> |
|||
</configuration> |
|||
</facet> |
|||
<facet type="android" name="Android"> |
|||
<configuration> |
|||
<option name="SELECTED_BUILD_VARIANT" value="debug" /> |
|||
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" /> |
|||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> |
|||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" /> |
|||
<afterSyncTasks> |
|||
<task>generateDebugSources</task> |
|||
</afterSyncTasks> |
|||
<option name="ALLOW_USER_CONFIGURATION" value="false" /> |
|||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> |
|||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> |
|||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> |
|||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> |
|||
</configuration> |
|||
</facet> |
|||
</component> |
|||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false"> |
|||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> |
|||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" /> |
|||
<exclude-output /> |
|||
<content url="file://$MODULE_DIR$"> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> |
|||
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/jars" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> |
|||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> |
|||
</content> |
|||
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" /> |
|||
<orderEntry type="sourceFolder" forTests="false" /> |
|||
<orderEntry type="library" exported="" name="design-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" name="support-annotations-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" name="animated-vector-drawable-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" /> |
|||
<orderEntry type="library" exported="" name="support-v4-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" name="recyclerview-v7-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" /> |
|||
<orderEntry type="library" exported="" name="support-vector-drawable-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" name="appcompat-v7-23.4.0" level="project" /> |
|||
<orderEntry type="library" exported="" name="android-android-25" level="project" /> |
|||
</component> |
|||
</module> |
@ -0,0 +1,27 @@ |
|||
apply plugin: 'com.android.application' |
|||
|
|||
android { |
|||
compileSdkVersion 25 |
|||
buildToolsVersion '25.0.2' |
|||
|
|||
defaultConfig { |
|||
applicationId "ru.defend.defdevteam.tstu" |
|||
minSdkVersion 15 |
|||
targetSdkVersion 23 |
|||
versionCode 1 |
|||
versionName "1.0" |
|||
} |
|||
buildTypes { |
|||
release { |
|||
minifyEnabled false |
|||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
|||
} |
|||
} |
|||
} |
|||
|
|||
dependencies { |
|||
compile fileTree(include: ['*.jar'], dir: 'libs') |
|||
testCompile 'junit:junit:4.12' |
|||
compile 'com.android.support:appcompat-v7:23.4.0' |
|||
compile 'com.android.support:design:23.4.0' |
|||
} |
@ -0,0 +1,17 @@ |
|||
# Add project specific ProGuard rules here. |
|||
# By default, the flags in this file are appended to flags specified |
|||
# in C:\Users\nikit_000\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt |
|||
# You can edit the include path and order by changing the proguardFiles |
|||
# directive in build.gradle. |
|||
# |
|||
# For more details, see |
|||
# http://developer.android.com/guide/developing/tools/proguard.html |
|||
|
|||
# Add any project specific keep options here: |
|||
|
|||
# If your project uses WebView with JS, uncomment the following |
|||
# and specify the fully qualified class name to the JavaScript interface |
|||
# class: |
|||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { |
|||
# public *; |
|||
#} |
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
|||
package="ru.defend.defdevteam.tstu"> |
|||
|
|||
<uses-permission android:name="android.permission.INTERNET" /> |
|||
|
|||
<application |
|||
android:allowBackup="true" |
|||
android:icon="@mipmap/ic_launcher" |
|||
android:label="@string/app_name" |
|||
android:supportsRtl="true" |
|||
android:theme="@style/AppTheme"> |
|||
<activity android:name=".MainActivity"> |
|||
<intent-filter> |
|||
<action android:name="android.intent.action.MAIN" /> |
|||
|
|||
<category android:name="android.intent.category.LAUNCHER" /> |
|||
</intent-filter> |
|||
</activity> |
|||
<activity |
|||
android:name=".WebActivity" |
|||
android:label="@string/title_activity_web" |
|||
android:theme="@style/AppTheme.NoActionBar"></activity> |
|||
</application> |
|||
|
|||
</manifest> |
@ -0,0 +1,89 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import android.app.Activity; |
|||
import android.widget.TextView; |
|||
|
|||
/** |
|||
* Created by thedefend on 29.11.16. |
|||
*/ |
|||
|
|||
public class FeedController { |
|||
|
|||
FeedReader feedReader; |
|||
FeedUpdater feedUpdater; |
|||
String newsFeed; |
|||
int updateRate; //in minutes
|
|||
private WebActivity activity; |
|||
|
|||
public FeedController(WebActivity activity, int updateRate) { |
|||
this(activity, updateRate, "http://press.tstu.ru/?format=feed"); |
|||
} |
|||
|
|||
public FeedController(WebActivity activity, int updateRate, String rssUrl) { |
|||
feedReader = new FeedReader(this, rssUrl); |
|||
feedUpdater = new FeedUpdater(); |
|||
this.activity = activity; |
|||
this.updateRate = updateRate; |
|||
feedUpdater.start(); |
|||
} |
|||
|
|||
private void startFeedReader() { |
|||
switch (feedReader.getThreadState()) { |
|||
case THREAD_FAIL: |
|||
feedReader.start(); |
|||
break; |
|||
case THREAD_NULL: |
|||
feedReader.start(); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
private boolean checkFeedReader() throws Exception{ |
|||
switch (feedReader.getThreadState()) { |
|||
case THREAD_COMPLETE: |
|||
return true; |
|||
case THREAD_NULL: |
|||
return false; |
|||
default: |
|||
throw new Exception("Failed to get rss source string from FeedReader class"); |
|||
} |
|||
} |
|||
|
|||
public void feedUpdateAction(final String result) { |
|||
activity.runOnUiThread(new Runnable() { |
|||
@Override |
|||
public void run() { |
|||
activity.newsTextView.setText(result); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
private class FeedUpdater extends Thread { |
|||
@Override |
|||
public void run() { |
|||
startFeedReader(); |
|||
try { |
|||
//TODO: вернуть к норме updateRate*60*1000
|
|||
sleep(updateRate*60); |
|||
} catch (InterruptedException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
public FeedUpdater() { |
|||
this.start(); |
|||
} |
|||
} |
|||
|
|||
public String getRssString() throws Exception{ |
|||
if(checkFeedReader()) { |
|||
newsFeed = feedReader.getResult(); |
|||
return newsFeed; |
|||
} |
|||
throw new Exception("Feed Reader returned empty string"); |
|||
} |
|||
|
|||
interface FeedCallback{ |
|||
void Callback(); |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import org.w3c.dom.Document; |
|||
import org.w3c.dom.Node; |
|||
|
|||
import javax.xml.parsers.DocumentBuilder; |
|||
import javax.xml.parsers.DocumentBuilderFactory; |
|||
|
|||
/** |
|||
* Created by thedefend on 29.11.16. |
|||
*/ |
|||
|
|||
public class FeedParser { |
|||
|
|||
FeedParser(String omg) { |
|||
try { |
|||
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
|||
// Создается дерево DOM документа из файла
|
|||
Document document = documentBuilder.parse(omg); |
|||
|
|||
// Получаем корневой элемент
|
|||
Node root = document.getDocumentElement(); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,75 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import android.os.Handler; |
|||
|
|||
import java.io.BufferedReader; |
|||
import java.io.InputStreamReader; |
|||
import java.net.URL; |
|||
|
|||
/** |
|||
* Created by thedefend on 28.11.16. |
|||
*/ |
|||
|
|||
public class FeedReader extends Thread implements FeedController.FeedCallback { |
|||
|
|||
private String link; |
|||
private String result; |
|||
private FeedController feedController; |
|||
public enum States { |
|||
THREAD_NULL, |
|||
THREAD_WORK, |
|||
THREAD_FAIL, |
|||
THREAD_COMPLETE |
|||
} |
|||
private States threadState; |
|||
|
|||
FeedReader (FeedController feedController, String link) { |
|||
this.link = link; |
|||
this.feedController = feedController; |
|||
this.threadState = States.THREAD_NULL; |
|||
} |
|||
|
|||
|
|||
public void run(){ |
|||
try { |
|||
this.threadState = States.THREAD_WORK; |
|||
this.result = getRss(link); |
|||
this.threadState = States.THREAD_COMPLETE; |
|||
//TODO: слишком сильная взаимосвязь с управляющим классом
|
|||
feedController.feedUpdateAction(result); |
|||
} catch (Exception e) { |
|||
this.threadState = States.THREAD_FAIL; |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
} |
|||
|
|||
private String getRss(String link) throws Exception { |
|||
String tempString = null; |
|||
String inputString = ""; |
|||
URL rssFeed = new URL(link); |
|||
BufferedReader inputStream = new BufferedReader( |
|||
new InputStreamReader(rssFeed.openStream())); |
|||
|
|||
do { |
|||
if(tempString != null) { |
|||
inputString += tempString; |
|||
} |
|||
tempString = inputStream.readLine(); |
|||
} while (tempString != null); |
|||
|
|||
return inputString; |
|||
} |
|||
|
|||
public States getThreadState() { |
|||
return this.threadState; |
|||
} |
|||
|
|||
public String getResult() { |
|||
return this.result; |
|||
} |
|||
|
|||
public void Callback(){ |
|||
|
|||
} |
|||
} |
@ -0,0 +1,140 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import android.content.Context; |
|||
import android.content.Intent; |
|||
import android.content.SharedPreferences; |
|||
import android.support.annotation.NonNull; |
|||
import android.support.v7.app.AppCompatActivity; |
|||
import android.os.Bundle; |
|||
import android.util.Log; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.view.ViewGroup; |
|||
import android.widget.ArrayAdapter; |
|||
import android.widget.CheckBox; |
|||
import android.widget.EditText; |
|||
import android.widget.ImageView; |
|||
import android.widget.ListView; |
|||
import android.widget.TextView; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
public class MainActivity extends AppCompatActivity { |
|||
private EditText login, password; |
|||
public ImageView logo; |
|||
private SharedPreferences sPref; |
|||
final String LOGIN = "login"; |
|||
final String PASSWORD = "password"; |
|||
final String CHECK = "check"; |
|||
public CheckBox check; |
|||
static public List<MainActivity.groupList> subs; |
|||
|
|||
|
|||
|
|||
public void authButtonOnClick(View v){ |
|||
if(check.isChecked()){ |
|||
saveForms(); |
|||
} |
|||
Intent WebA = new Intent(this, WebActivity.class); |
|||
WebA.putExtra("login", login.getText().toString()); |
|||
WebA.putExtra("pass", password.getText().toString()); |
|||
startActivity(WebA); |
|||
//onFeedReaderComplete();
|
|||
} |
|||
|
|||
//TODO: Проверка авторизации здеся, хотя как ее тут пилить, когда ее нету лооол!
|
|||
void saveForms() { |
|||
sPref = getPreferences(MODE_PRIVATE); |
|||
SharedPreferences.Editor ed = sPref.edit(); |
|||
ed.putString(LOGIN, login.getText().toString()); |
|||
ed.putString(PASSWORD, password.getText().toString()); |
|||
ed.putBoolean(CHECK, check.isChecked()); |
|||
ed.apply(); |
|||
} |
|||
|
|||
void loadForms() { |
|||
sPref = getPreferences(MODE_PRIVATE); |
|||
login.setText(sPref.getString(LOGIN, "")); |
|||
password.setText(sPref.getString(PASSWORD, "")); |
|||
check.setChecked(sPref.getBoolean(CHECK, false)); |
|||
} |
|||
|
|||
public void updateForms(View v){ |
|||
if(!check.isChecked()) { |
|||
password.setText(""); |
|||
saveForms(); |
|||
} |
|||
else { |
|||
saveForms(); |
|||
} |
|||
} |
|||
|
|||
|
|||
public class subsAdapter extends ArrayAdapter<groupList> { |
|||
public subsAdapter(Context context) { |
|||
super(context, android.R.layout.simple_list_item_multiple_choice, subs); |
|||
} |
|||
|
|||
@Override |
|||
public View getView(int position, View convertView, ViewGroup parent) { |
|||
groupList group = getItem(position); |
|||
|
|||
if(convertView == null){ |
|||
convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_list_item_multiple_choice, null); |
|||
} |
|||
((TextView) convertView.findViewById(android.R.id.text1)).setText(group.name); |
|||
return convertView; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
public class groupList { |
|||
public String name, rate; |
|||
public groupList(String name, String rate){ |
|||
this.name = name; |
|||
this.rate = rate; |
|||
} |
|||
} |
|||
|
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.main); |
|||
login = (EditText) findViewById(R.id.editLogin); |
|||
password = (EditText) findViewById(R.id.passEdit); |
|||
check = (CheckBox) findViewById(R.id.save); |
|||
loadForms(); |
|||
//TODO: убрать потом
|
|||
subs = new ArrayList<groupList>(); |
|||
subs.add(new groupList("test","test")); |
|||
subs.add(new groupList("test","test")); |
|||
subs.add(new groupList("test","test")); |
|||
subs.add(new groupList("test","test")); |
|||
setContentView(R.layout.subscriptions); |
|||
ArrayAdapter<groupList> subsL = new subsAdapter(this); |
|||
ListView subsList = (ListView) findViewById(R.id.subsList); |
|||
subsList.setAdapter(subsL); |
|||
} |
|||
|
|||
@Override |
|||
protected void onResume() { |
|||
super.onResume(); |
|||
Intent intent = getIntent(); |
|||
if (!(intent.getStringExtra("error") == null)) { |
|||
Log.i("TESTINGG", intent.getStringExtra("error")); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
protected void onDestroy() { |
|||
super.onDestroy(); |
|||
if(check.isChecked()) saveForms(); |
|||
} |
|||
|
|||
public void OnSubsListClick(View v) { |
|||
|
|||
} |
|||
} |
@ -0,0 +1,550 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import android.annotation.TargetApi; |
|||
import android.content.Context; |
|||
import android.content.Intent; |
|||
import android.os.Bundle; |
|||
import android.support.annotation.NonNull; |
|||
import android.support.design.widget.FloatingActionButton; |
|||
import android.support.design.widget.Snackbar; |
|||
import android.util.Log; |
|||
import android.view.LayoutInflater; |
|||
import android.view.View; |
|||
import android.support.design.widget.NavigationView; |
|||
import android.support.v4.view.GravityCompat; |
|||
import android.support.v4.widget.DrawerLayout; |
|||
import android.support.v7.app.ActionBarDrawerToggle; |
|||
import android.support.v7.app.AppCompatActivity; |
|||
import android.support.v7.widget.Toolbar; |
|||
import android.view.Menu; |
|||
import android.view.MenuItem; |
|||
import android.view.ViewGroup; |
|||
import android.webkit.ValueCallback; |
|||
import android.webkit.WebSettings; |
|||
import android.webkit.WebView; |
|||
import android.webkit.WebViewClient; |
|||
import android.widget.ArrayAdapter; |
|||
import android.widget.Chronometer; |
|||
import android.widget.ListView; |
|||
import android.widget.RelativeLayout; |
|||
import android.widget.TextView; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.regex.Matcher; |
|||
import java.util.regex.Pattern; |
|||
|
|||
|
|||
public class WebActivity extends AppCompatActivity |
|||
implements NavigationView.OnNavigationItemSelectedListener { |
|||
|
|||
|
|||
public WebView browser; |
|||
public WebSettings browserSet; |
|||
static public String AuthURL, MainURL, AdditionalURL ,JournalURL, RateValueURL, GroupRateURL, |
|||
FacultyRateURL, siteBuf; |
|||
static public String MainHTML, AdditionalHTML, JournalHTML, RateValueHTML, GroupRateHTML, |
|||
FacultyRateHTML; |
|||
boolean authBegin,taskFinished = false; |
|||
public TextView studentName, studentGroup, studentRate, positionGroup, |
|||
positionFaculty, newsTextView; |
|||
public RelativeLayout profileLayout, journalLayout, gRateLayout, |
|||
fRateLayout, aboutLayout, progressLayout, newsLayout; |
|||
public Toolbar myToolbar; |
|||
public Chronometer timer; |
|||
static public List<groupList> group, faculty, subs; |
|||
Intent MainA; |
|||
FeedController feedController; |
|||
|
|||
|
|||
public class groupList { |
|||
public String name, rate; |
|||
public groupList(String name, String rate){ |
|||
this.name = name; |
|||
this.rate = rate; |
|||
} |
|||
} |
|||
|
|||
public class groupAdapter extends ArrayAdapter<groupList> { |
|||
public groupAdapter(Context context){ |
|||
super(context, android.R.layout.simple_list_item_2, group); |
|||
} |
|||
|
|||
@Override |
|||
public View getView(int position, View convertView, ViewGroup parent){ |
|||
groupList group = getItem(position); |
|||
|
|||
if (convertView == null){ |
|||
convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_list_item_2, null); |
|||
} |
|||
|
|||
((TextView) convertView.findViewById(android.R.id.text1)).setText(group.name); |
|||
((TextView) convertView.findViewById(android.R.id.text2)).setText(group.rate); |
|||
|
|||
return convertView; |
|||
} |
|||
|
|||
} |
|||
|
|||
public class subsAdapter extends ArrayAdapter<groupList> { |
|||
public subsAdapter(Context context) { |
|||
super(context, android.R.layout.simple_selectable_list_item); |
|||
} |
|||
|
|||
@NonNull |
|||
@Override |
|||
public View getView(int position, View convertView, ViewGroup parent) { |
|||
groupList group = getItem(position); |
|||
|
|||
if(convertView == null){ |
|||
convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_selectable_list_item, null); |
|||
} |
|||
((TextView) convertView.findViewById(android.R.id.text1)).setText(group.name); |
|||
return convertView; |
|||
} |
|||
} |
|||
|
|||
public class facultyAdapter extends ArrayAdapter<groupList> { |
|||
public facultyAdapter(Context context){ |
|||
super(context, android.R.layout.simple_list_item_2, faculty); |
|||
} |
|||
|
|||
@Override |
|||
public View getView(int position, View convertView, ViewGroup parent){ |
|||
groupList group = getItem(position); |
|||
|
|||
if (convertView == null){ |
|||
convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_list_item_2, null); |
|||
} |
|||
|
|||
((TextView) convertView.findViewById(android.R.id.text1)).setText(group.name); |
|||
((TextView) convertView.findViewById(android.R.id.text2)).setText(group.rate); |
|||
|
|||
return convertView; |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
protected void onCreate(Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
setContentView(R.layout.cabinet); |
|||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
|||
setSupportActionBar(toolbar); |
|||
|
|||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); |
|||
fab.setOnClickListener(new View.OnClickListener() { |
|||
@Override |
|||
public void onClick(View view) { |
|||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) |
|||
.setAction("Action", null).show(); |
|||
} |
|||
}); |
|||
|
|||
final DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); |
|||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( |
|||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); |
|||
// toolbar.setNavigationOnClickListener(
|
|||
// new View.OnClickListener() {
|
|||
// @Override
|
|||
// public void onClick(View view) {
|
|||
// Log.d("Toolbar","Hmmm...");
|
|||
// if(drawer.isDrawerOpen(GravityCompat.START)){
|
|||
// drawer.openDrawer(GravityCompat.START);
|
|||
// }
|
|||
// }
|
|||
// });
|
|||
toggle.syncState(); |
|||
|
|||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); |
|||
navigationView.setNavigationItemSelectedListener(this); |
|||
|
|||
MainA = getIntent(); |
|||
|
|||
|
|||
|
|||
browser = (WebView) findViewById(R.id.webView); |
|||
browser.setWebViewClient(new MyWebViewClient()); |
|||
browserSet = browser.getSettings(); |
|||
browserSet.setJavaScriptEnabled(true); |
|||
studentName = (TextView) findViewById(R.id.studentName); |
|||
studentRate = (TextView) findViewById(R.id.studentRate); |
|||
studentGroup = (TextView) findViewById(R.id.studentGroup); |
|||
positionFaculty = (TextView) findViewById(R.id.positionFaculty); |
|||
newsTextView = (TextView) findViewById(R.id.newsTextView); |
|||
positionGroup = (TextView) findViewById(R.id.positionGroup); |
|||
profileLayout = (RelativeLayout) findViewById(R.id.profileLayout); |
|||
journalLayout = (RelativeLayout) findViewById(R.id.journalList); |
|||
gRateLayout = (RelativeLayout) findViewById(R.id.gRateLayout); |
|||
fRateLayout = (RelativeLayout) findViewById(R.id.fRateLayout); |
|||
aboutLayout = (RelativeLayout) findViewById(R.id.aboutLayout); |
|||
progressLayout = (RelativeLayout) findViewById(R.id.progressLayout); |
|||
newsLayout = (RelativeLayout) findViewById(R.id.newsLayout); |
|||
progressLayout.setVisibility(View.VISIBLE); |
|||
profileLayout.setVisibility(View.VISIBLE); |
|||
myToolbar = (Toolbar) findViewById(R.id.toolbar); |
|||
setSupportActionBar(myToolbar); |
|||
navigationView.getMenu().getItem(1).setChecked(true); |
|||
myToolbar.setTitle(R.string.title_profile); |
|||
|
|||
|
|||
feedController = new FeedController(this, 1); |
|||
|
|||
AuthURL = "http://web-iais.admin.tstu.ru:7777/zion/f?p=stud_main"; |
|||
loadSite(); |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void onBackPressed() { |
|||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); |
|||
if (drawer.isDrawerOpen(GravityCompat.START)) { |
|||
drawer.closeDrawer(GravityCompat.START); |
|||
} else { |
|||
super.onBackPressed(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public boolean onCreateOptionsMenu(Menu menu) { |
|||
getMenuInflater().inflate(R.menu.cabinet, menu); |
|||
return true; |
|||
} |
|||
|
|||
@Override |
|||
public boolean onOptionsItemSelected(MenuItem item) { |
|||
// Handle action bar item clicks here. The action bar will
|
|||
// automatically handle clicks on the Home/Up button, so long
|
|||
// as you specify a parent activity in AndroidManifest.xml.
|
|||
int id = item.getItemId(); |
|||
|
|||
//noinspection SimplifiableIfStatement
|
|||
if (id == R.id.action_settings) { |
|||
return true; |
|||
} |
|||
|
|||
return super.onOptionsItemSelected(item); |
|||
} |
|||
|
|||
@Override |
|||
public boolean onNavigationItemSelected(MenuItem item) { |
|||
int id = item.getItemId(); |
|||
newsLayout.setVisibility(View.INVISIBLE); |
|||
profileLayout.setVisibility(View.INVISIBLE); |
|||
journalLayout.setVisibility(View.INVISIBLE); |
|||
gRateLayout.setVisibility(View.INVISIBLE); |
|||
fRateLayout.setVisibility(View.INVISIBLE); |
|||
aboutLayout.setVisibility(View.INVISIBLE); |
|||
if(!taskFinished) { |
|||
progressLayout.setVisibility(View.VISIBLE); |
|||
} |
|||
switch (id) { |
|||
case R.id.nav_newsfeed: |
|||
progressLayout.setVisibility(View.INVISIBLE); |
|||
newsLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_newsfeed); |
|||
break; |
|||
case R.id.nav_profile: |
|||
profileLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_profile); |
|||
break; |
|||
case R.id.nav_journal: |
|||
journalLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_journal); |
|||
break; |
|||
case R.id.nav_grouprate: |
|||
gRateLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_grouprate); |
|||
break; |
|||
case R.id.nav_facultyrate: |
|||
fRateLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_globalrate); |
|||
break; |
|||
case R.id.nav_aboutapp: |
|||
progressLayout.setVisibility(View.INVISIBLE); |
|||
aboutLayout.setVisibility(View.VISIBLE); |
|||
myToolbar.setTitle(R.string.title_about_dev); |
|||
break; |
|||
case R.id.nav_changeacc: |
|||
finish(); |
|||
break; |
|||
} |
|||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); |
|||
drawer.closeDrawer(GravityCompat.START); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
|
|||
public static StringBuffer removeUTFCharacters(String data){ |
|||
Pattern p = Pattern.compile("\\\\u(\\p{XDigit}{4})"); |
|||
Matcher m = p.matcher(data); |
|||
StringBuffer buf = new StringBuffer(data.length()); |
|||
while (m.find()) { |
|||
String ch = String.valueOf((char) Integer.parseInt(m.group(1), 16)); |
|||
m.appendReplacement(buf, Matcher.quoteReplacement(ch)); |
|||
} |
|||
m.appendTail(buf); |
|||
return buf; |
|||
} |
|||
|
|||
public void loadSite () { |
|||
browser.loadUrl(AuthURL); |
|||
} |
|||
|
|||
public String cutLine(String a, String b, String Line){ |
|||
if(Line.contains(a)) Line = Line.substring(Line.indexOf(a)+ a.length()); |
|||
if(Line.contains(b)) { |
|||
if(b == ""){ |
|||
return Line; |
|||
} |
|||
Line = Line.substring(0, Line.indexOf(b)); |
|||
return Line; |
|||
} else { |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
public String cutLine(String a, String b, String Line, boolean hard){ |
|||
if ((!Line.contains(a)) || (a.equals("")) ) return ""; |
|||
if ((!Line.contains(b)) || (b.equals("")) ) return ""; |
|||
Line = Line.substring(Line.indexOf(a)+ a.length()); |
|||
Line = Line.substring(0, Line.indexOf(b)); |
|||
return Line; |
|||
} |
|||
|
|||
|
|||
// НЕИЗВЕСТНОЕ ИСКЛЮЧЕНИЕ
|
|||
public void unknownState(int currentState){ |
|||
Log.e("unknownState","Не удалось получить ссылки на странице студента"); |
|||
Log.e("unknownState",browser.getUrl()); |
|||
finish(); |
|||
} |
|||
// АВТОРИЗАЦИЯ
|
|||
public boolean Auth () { |
|||
authBegin = true; |
|||
String login = MainA.getStringExtra("login"); |
|||
String password = MainA.getStringExtra("pass"); |
|||
Log.i("Auth|Login", login); |
|||
Log.i("Auth|Password", password); |
|||
//console("Auth|Password",MainActivity.password.getText().toString());
|
|||
//browser.loadUrl("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'s75389','P101_PASSWORD':'v97KFxmP'}});");
|
|||
browser.loadUrl("javascript:apex.submit({request:'LOGIN',set:{'P101_USERNAME':'"+login+"','P101_PASSWORD':'"+password+"'}});"); |
|||
return true; |
|||
} |
|||
|
|||
public byte sessionState () { |
|||
if(taskFinished) return 127; |
|||
Intent intent = new Intent(); |
|||
Log.i("sessionActive","Checking session"); |
|||
String a = cutLine("http://web-iais.admin.tstu.ru:7777/zion/f?p=503:",":",browser.getUrl()); |
|||
switch (a){ |
|||
case "LOGIN_DESKTOP": |
|||
Log.i("sessionActive","Окно авторизации"); |
|||
//MainActivity.error.setText("Конец сессии авторизации");
|
|||
finish(); |
|||
return 0; |
|||
case "er": |
|||
Log.i("sessionActive","Окно авторизации"); |
|||
//MainActivity.error.setText("Ошибка авторизации");
|
|||
finish(); |
|||
return 1; |
|||
case "1": |
|||
Log.i("sessionActive","Страница студента"); |
|||
intent.putExtra("error","Вход производился успешно"); |
|||
MainURL = browser.getUrl(); |
|||
taskGenerator(2); |
|||
return 2; |
|||
case "40": |
|||
Log.i("sessionActive","Страница - Успеваемость"); |
|||
taskGenerator(3); |
|||
return 3; |
|||
case "41": |
|||
Log.i("sessionActive","Страница - Журналы|Главная"); |
|||
taskGenerator(4); |
|||
return 4; |
|||
case "43": |
|||
Log.i("sessionActive","Страница - Рейтинг|Главная"); |
|||
String s = cutLine("","503:",MainURL) + "503:43:" + cutLine(":1:","",MainURL)+":"; |
|||
if(cutLine(s,":NO:",browser.getUrl()).equals("RATE_GROUP")) { |
|||
taskGenerator(6); |
|||
return 6; |
|||
} |
|||
if(cutLine(s,":NO:",browser.getUrl()).equals("RATE_INST")) { |
|||
taskGenerator(7); |
|||
return 7; |
|||
} |
|||
taskGenerator(5); |
|||
return 5; |
|||
|
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
|
|||
// Контент генератор
|
|||
public void taskGenerator(int state){ |
|||
if (!isFinishing()) |
|||
switch (state){ |
|||
case 2: |
|||
MainHTML = siteBuf; |
|||
String studNameGroup = cutLine("<span id=\\\"P1_STUD\\\" class=\\\"display_only\\\" style=\\\"font-size: 120%; font-family:Verdana, Arial, Helvetica, sans-serif; color: #0000FF; font-weight:bold\\\">", |
|||
"</span>", |
|||
MainHTML); |
|||
studentName.setText(cutLine(""," /",studNameGroup)); |
|||
studentGroup.setText("Группа: " + cutLine("/ ","",studNameGroup)); |
|||
browser.loadUrl("javascript:apex.submit('T_ЗАНЯТИЯ/ОЦЕНКИ');"); |
|||
break; |
|||
case 3: |
|||
AdditionalHTML = siteBuf; |
|||
JournalURL = "http://web-iais.admin.tstu.ru:7777/zion/" + |
|||
cutLine("<td headers=\\\"BRS\\\"><a href=\\\"","\" title=\\\"Просмотр журналов\\\">",AdditionalHTML); |
|||
RateValueURL = "http://web-iais.admin.tstu.ru:7777/zion/" + |
|||
cutLine("<td headers=\\\"RTG\\\"><a href=\\\"","\\\" title=\\\"Просмотр успеваемости\\\">",AdditionalHTML); |
|||
browser.loadUrl(JournalURL); |
|||
break; |
|||
case 4: |
|||
JournalHTML = siteBuf; |
|||
browser.loadUrl(RateValueURL); |
|||
break; |
|||
case 5: |
|||
RateValueHTML = siteBuf; |
|||
String rate = cutLine("<td align=\\\"center\\\" headers=\\\"STUDRATE\\\">","</td>",RateValueHTML); |
|||
studentRate.setText("Балл: " + rate); |
|||
GroupRateURL = "http://web-iais.admin.tstu.ru:7777/zion/" + cutLine("><td headers=\\\"GROUP_NAME\\\"><a href=\\\"","\\\">",RateValueHTML); |
|||
FacultyRateURL = "http://web-iais.admin.tstu.ru:7777/zion/" + cutLine("<td headers=\\\"INST\\\"><a href=\\\"","\\\">", RateValueHTML); |
|||
browser.loadUrl(GroupRateURL); |
|||
break; |
|||
case 6: |
|||
GroupRateHTML = siteBuf; |
|||
fillGroup(); |
|||
browser.loadUrl(FacultyRateURL); |
|||
break; |
|||
case 7: |
|||
FacultyRateHTML = siteBuf; |
|||
fillFaculty(); |
|||
fillAll(); |
|||
taskFinished = true; |
|||
progressLayout.setVisibility(View.INVISIBLE); |
|||
break; |
|||
} |
|||
|
|||
} |
|||
|
|||
public void fillGroup(){ |
|||
group = new ArrayList<groupList>(); |
|||
String n,r; |
|||
String gr = siteBuf; |
|||
gr = cutLine("<h1>Рейтинг в группе</h1>", "", gr); |
|||
int i = 0; |
|||
while ( !(cutLine("<tr><td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</tr>",gr,true) == "")){ |
|||
Integer s = Integer.valueOf(cutLine("<td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</td>",gr)); |
|||
if(s == (i+1)) { |
|||
n = cutLine("<td headers=\\\"STUDNAME\\\">", "</td>", gr); |
|||
if (!(cutLine("<font color=\\\"red\\\"><b>", "</b></font>", n) == "")) |
|||
n = cutLine("<font color=\\\"red\\\"><b>", "</b></font>",n); |
|||
r = cutLine("<td align=\\\"center\\\" headers=\\\"STUDRATE\\\">", "</td>", gr); |
|||
r += " | Группа: " + cutLine("<td headers=\\\"GROUP_NAME\\\">","</td>", gr, true); |
|||
group.add(new groupList(n,"Общий балл: " + r)); |
|||
i++; |
|||
} |
|||
gr = cutLine("</td></tr>\\n", "", gr); |
|||
} |
|||
ArrayAdapter<groupList> groupL = new groupAdapter(this); |
|||
ListView groupList = (ListView) findViewById(R.id.groupList); |
|||
groupList.setAdapter(groupL); |
|||
} |
|||
|
|||
public void fillFaculty(){ |
|||
faculty = new ArrayList<groupList>(); |
|||
String n,r; |
|||
String fr = siteBuf; |
|||
fr = cutLine("<h1>Рейтинг в институте/факультете</h1>", "", fr); |
|||
int i = 0; |
|||
while ( !(cutLine("<tr><td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</tr>",fr,true) == "")){ |
|||
Integer s = Integer.valueOf(cutLine("<td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</td>",fr)); |
|||
if(s == (i+1)) { |
|||
n = cutLine("<td headers=\\\"STUDNAME\\\">", "</td>", fr); |
|||
if (!(cutLine("<font color=\\\"red\\\"><b>", "</b></font>", n) == "")) |
|||
n = cutLine("<font color=\\\"red\\\"><b>", "</b></font>",n); |
|||
r = cutLine("<td align=\\\"center\\\" headers=\\\"STUDRATE\\\">", "</td>", fr); |
|||
r += " | Группа: " + cutLine("<td headers=\\\"GROUP_NAME\\\">","</td>", fr, true); |
|||
faculty.add(new groupList(n,"Общий балл: " + r)); |
|||
i++; |
|||
} |
|||
fr = cutLine("</td></tr>\\n", "", fr); |
|||
} |
|||
ArrayAdapter<groupList> facultyL = new facultyAdapter(this); |
|||
ListView facultyList = (ListView) findViewById(R.id.facultyList); |
|||
facultyList.setAdapter(facultyL); |
|||
} |
|||
|
|||
|
|||
//TODO: Переделать к хуям позор ниже
|
|||
public void fillAll(){ |
|||
String s; |
|||
String s2 = GroupRateHTML; |
|||
s = cutLine("<tr>","</tr>",GroupRateHTML); |
|||
s = cutLine("<font","</font>",s); |
|||
while (s.equals("")) { |
|||
s2 = cutLine("</tr>","",s2); |
|||
s = cutLine("<tr>","</tr>",s2); |
|||
s = cutLine("<font","</font>",s); |
|||
} |
|||
s2 = cutLine("<td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</td>",s2); |
|||
Log.i("GroupPos",s2); |
|||
positionGroup.setText("Место в группе: " + s2); |
|||
s = ""; |
|||
s2 = FacultyRateHTML; |
|||
s = cutLine("<tr>","</tr>",FacultyRateHTML); |
|||
s = cutLine("<font","</font>",s); |
|||
while (s.equals("")) { |
|||
s2 = cutLine("</tr>","",s2); |
|||
s = cutLine("<tr>","</tr>",s2); |
|||
s = cutLine("<font","</font>",s); |
|||
} |
|||
s2 = cutLine("<td align=\\\"center\\\" headers=\\\"ROWNUM\\\">","</td>",s2); |
|||
Log.i("FacultyPos",s2); |
|||
positionFaculty.setText("Место в институте: " + s2); |
|||
} |
|||
|
|||
public void buttonRefresh (View v) { |
|||
getHTML(); |
|||
} |
|||
|
|||
public void buttonLogout (View v) { |
|||
finish(); |
|||
} |
|||
|
|||
@TargetApi(19) |
|||
public void getHTML(){ |
|||
|
|||
browser.evaluateJavascript("javascript:document.documentElement.outerHTML;", new ValueCallback<String>() { |
|||
@Override |
|||
public void onReceiveValue(String s) { |
|||
siteBuf = s; |
|||
encodeHTML(); |
|||
if(!authBegin) Auth(); |
|||
else sessionState(); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
public void encodeHTML(){ |
|||
if(siteBuf != null){ |
|||
siteBuf = removeUTFCharacters(siteBuf).toString(); |
|||
Log.d("Response html","Загружена страница "+cutLine("<title>","</title>",siteBuf)); |
|||
Log.i("encodeHTML",siteBuf); |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
private class MyWebViewClient extends WebViewClient { |
|||
@Override |
|||
public void onPageFinished(WebView view, String url) { |
|||
getHTML(); |
|||
Log.i("onPageFinished",browser.getUrl()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" /> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" /> |
|||
</vector> |
@ -0,0 +1,9 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" /> |
|||
</vector> |
@ -0,0 +1,9 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" /> |
|||
</vector> |
@ -0,0 +1,9 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" /> |
|||
</vector> |
@ -0,0 +1,9 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" /> |
|||
</vector> |
@ -0,0 +1,9 @@ |
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:width="24dp" |
|||
android:height="24dp" |
|||
android:viewportHeight="24.0" |
|||
android:viewportWidth="24.0"> |
|||
<path |
|||
android:fillColor="#FF000000" |
|||
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" /> |
|||
</vector> |
After Width: | Height: | Size: 9.7 KiB |
@ -0,0 +1,9 @@ |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle"> |
|||
<gradient |
|||
android:angle="135" |
|||
android:centerColor="#235AB0" |
|||
android:endColor="#FFFFFF" |
|||
android:startColor="#235AB0" |
|||
android:type="linear" /> |
|||
</shape> |
@ -0,0 +1,5 @@ |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="rectangle"> |
|||
|
|||
|
|||
</shape> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:fitsSystemWindows="true" |
|||
tools:context="ru.defend.defdevteam.tstu.WebActivity" |
|||
android:visibility="visible"> |
|||
|
|||
<android.support.design.widget.AppBarLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:theme="@style/AppTheme.AppBarOverlay" |
|||
android:visibility="visible"> |
|||
|
|||
<android.support.v7.widget.Toolbar |
|||
android:id="@+id/toolbar" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="?attr/actionBarSize" |
|||
android:background="?attr/colorPrimary" |
|||
app:popupTheme="@style/AppTheme.PopupOverlay" |
|||
android:visibility="visible" /> |
|||
|
|||
</android.support.design.widget.AppBarLayout> |
|||
|
|||
<include layout="@layout/content_cabinet" /> |
|||
|
|||
<android.support.design.widget.FloatingActionButton |
|||
android:id="@+id/fab" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="bottom|end" |
|||
android:layout_margin="@dimen/fab_margin" |
|||
android:src="@android:drawable/ic_menu_set_as" |
|||
android:visibility="invisible" /> |
|||
|
|||
</android.support.design.widget.CoordinatorLayout> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:id="@+id/drawer_layout" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:fitsSystemWindows="true" |
|||
tools:openDrawer="start"> |
|||
|
|||
<include |
|||
layout="@layout/app_bar_web" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" /> |
|||
|
|||
<android.support.design.widget.NavigationView |
|||
android:id="@+id/nav_view" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="match_parent" |
|||
android:layout_gravity="start" |
|||
android:fitsSystemWindows="true" |
|||
app:headerLayout="@layout/nav_header_cabinet" |
|||
app:menu="@menu/cabinet_drawer" /> |
|||
|
|||
</android.support.v4.widget.DrawerLayout> |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/aboutLayout" > |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceLarge" |
|||
android:text="@string/about_title" |
|||
android:id="@+id/textView3" |
|||
android:layout_marginTop="25dp" |
|||
android:layout_alignParentTop="true" |
|||
android:layout_centerHorizontal="true" |
|||
android:textStyle="normal" |
|||
android:layout_marginRight="20dp" |
|||
android:layout_marginLeft="20dp"/> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/creator" |
|||
android:layout_marginRight="20dp" |
|||
android:id="@+id/textView5" |
|||
android:layout_gravity="center_horizontal|bottom" |
|||
android:layout_marginTop="49dp" |
|||
android:layout_below="@+id/textView4" |
|||
android:layout_alignRight="@+id/textView4" |
|||
android:layout_alignEnd="@+id/textView4" /> |
|||
|
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceMedium" |
|||
android:text="@string/about_content" |
|||
android:id="@+id/textView4" |
|||
android:gravity="center" |
|||
android:layout_below="@+id/textView3" |
|||
android:layout_alignParentRight="true" |
|||
android:layout_alignParentEnd="true" |
|||
android:layout_marginTop="11dp" /> |
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:showIn="@layout/content_cabinet"> |
|||
|
|||
<ListView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/facultyList" |
|||
android:visibility="visible" /> |
|||
</RelativeLayout> |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:showIn="@layout/content_cabinet"> |
|||
|
|||
<ListView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/groupList" |
|||
android:visibility="visible" /> |
|||
</RelativeLayout> |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:showIn="@layout/content_cabinet"> |
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
tools:showIn="@layout/content_cabinet"> |
|||
|
|||
<TextView |
|||
android:text="TextView" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/newsTextView" /> |
|||
</RelativeLayout> |
@ -0,0 +1,69 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent"> |
|||
|
|||
<WebView |
|||
android:layout_width="fill_parent" |
|||
android:layout_height="fill_parent" |
|||
android:id="@+id/webView" |
|||
android:visibility="invisible" |
|||
android:alpha="0.2" |
|||
android:layout_alignParentTop="true" |
|||
android:layout_alignParentLeft="true" |
|||
android:layout_alignParentStart="true" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceLarge" |
|||
android:text="@string/student_surname_name" |
|||
android:id="@+id/studentName" |
|||
android:layout_alignParentTop="true" |
|||
android:layout_alignParentLeft="true" |
|||
android:layout_alignParentStart="true" |
|||
android:layout_marginLeft="24dp" |
|||
android:layout_marginStart="24dp" |
|||
android:layout_marginTop="22dp" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceMedium" |
|||
android:text="Группа: " |
|||
android:id="@+id/studentGroup" |
|||
android:layout_below="@+id/studentName" |
|||
android:layout_alignLeft="@+id/studentName" |
|||
android:layout_alignStart="@+id/studentName" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceMedium" |
|||
android:text="Балл:" |
|||
android:id="@+id/studentRate" |
|||
android:layout_below="@+id/studentGroup" |
|||
android:layout_alignLeft="@+id/studentGroup" |
|||
android:layout_alignStart="@+id/studentGroup" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceMedium" |
|||
android:text="Место в группе:" |
|||
android:id="@+id/positionGroup" |
|||
android:layout_below="@+id/studentRate" |
|||
android:layout_alignLeft="@+id/studentRate" |
|||
android:layout_alignStart="@+id/studentRate" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:textAppearance="?android:attr/textAppearanceMedium" |
|||
android:text="Место в институте:" |
|||
android:id="@+id/positionFaculty" |
|||
android:layout_below="@+id/positionGroup" |
|||
android:layout_alignLeft="@+id/positionGroup" |
|||
android:layout_alignStart="@+id/positionGroup" /> |
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
<ProgressBar |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/progressBar" |
|||
android:layout_gravity="center" |
|||
android:layout_centerVertical="true" |
|||
android:layout_centerHorizontal="true" /> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/progress_content" |
|||
android:id="@+id/textView" |
|||
android:layout_gravity="center_horizontal|bottom" |
|||
android:layout_below="@+id/progressBar" |
|||
android:layout_centerHorizontal="true" /> |
|||
|
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,54 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
|||
tools:context="ru.defend.defdevteam.tstu.WebActivity" |
|||
tools:showIn="@layout/app_bar_web" |
|||
android:id="@+id/mainLayout"> |
|||
|
|||
<include layout="@layout/cabinet_about" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/aboutLayout" |
|||
android:visibility="invisible"/> |
|||
|
|||
<include layout="@layout/cabinet_journallist" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/journalList" |
|||
android:visibility="invisible"/> |
|||
|
|||
<include layout="@layout/cabinet_grouplist" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/gRateLayout" |
|||
android:visibility="invisible"/> |
|||
|
|||
<include layout="@layout/cabinet_progress" |
|||
android:layout_height="match_parent" |
|||
android:layout_width="match_parent" |
|||
android:id="@+id/progressLayout" |
|||
android:visibility="invisible"/> |
|||
|
|||
<include layout="@layout/cabinet_profile" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/profileLayout" |
|||
android:visibility="invisible"/> |
|||
|
|||
<include layout="@layout/cabinet_facultylist" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/fRateLayout" |
|||
android:visibility="invisible" /> |
|||
|
|||
<include layout="@layout/cabinet_newsfeed" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:id="@+id/newsLayout" |
|||
android:visibility="invisible"/> |
|||
|
|||
</RelativeLayout> |
@ -0,0 +1,79 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" |
|||
|
|||
android:paddingRight="@dimen/activity_horizontal_margin" |
|||
android:paddingTop="@dimen/activity_vertical_margin" |
|||
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> |
|||
|
|||
<FrameLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:visibility="visible"> |
|||
|
|||
<TextView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/creator" |
|||
android:id="@+id/textView" |
|||
android:layout_gravity="center_horizontal|bottom" /> |
|||
</FrameLayout> |
|||
|
|||
<LinearLayout |
|||
android:orientation="vertical" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:layout_alignParentTop="true" |
|||
android:layout_centerHorizontal="true"> |
|||
|
|||
<ImageView |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/logoView" |
|||
android:layout_gravity="center_horizontal" |
|||
android:background="@drawable/logo"/> |
|||
|
|||
<EditText |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/editLogin" |
|||
android:layout_gravity="center_horizontal" |
|||
android:hint="@string/hint_login" /> |
|||
|
|||
<EditText |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:inputType="textPassword" |
|||
android:id="@+id/passEdit" |
|||
android:layout_gravity="center_horizontal" |
|||
android:hint="@string/hint_password" /> |
|||
|
|||
<FrameLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:layout_gravity="center_horizontal"> |
|||
|
|||
<CheckBox |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/checkbox_remember_user" |
|||
android:id="@+id/save" |
|||
android:layout_gravity="left|center_vertical" |
|||
android:onClick="updateForms" /> |
|||
|
|||
<Button |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/app_log_in" |
|||
android:id="@+id/authButton" |
|||
android:layout_gravity="right|center_vertical" |
|||
android:clickable="true" |
|||
android:enabled="true" |
|||
android:onClick="authButtonOnClick" /> |
|||
</FrameLayout> |
|||
|
|||
</LinearLayout> |
|||
</RelativeLayout> |
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="@dimen/nav_header_height" |
|||
android:background="@drawable/side_nav_bar" |
|||
android:gravity="bottom" |
|||
android:orientation="vertical" |
|||
android:paddingBottom="@dimen/activity_vertical_margin" |
|||
android:paddingLeft="@dimen/activity_horizontal_margin" |
|||
android:paddingRight="@dimen/activity_horizontal_margin" |
|||
android:paddingTop="@dimen/activity_vertical_margin" |
|||
android:theme="@style/ThemeOverlay.AppCompat.Dark"> |
|||
|
|||
<ImageView |
|||
android:id="@+id/imageView" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:paddingTop="@dimen/nav_header_vertical_spacing" |
|||
android:background="@mipmap/ic_launcher" /> |
|||
|
|||
<TextView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="wrap_content" |
|||
android:paddingTop="@dimen/nav_header_vertical_spacing" |
|||
android:text="@string/nav_header_title" |
|||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> |
|||
|
|||
<TextView |
|||
android:id="@+id/textView" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:text="@string/dev_site" /> |
|||
|
|||
</LinearLayout> |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:orientation="vertical" android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
</LinearLayout> |
@ -0,0 +1,61 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
android:orientation="vertical" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent" |
|||
android:screenOrientation="portrait"> |
|||
|
|||
<RelativeLayout |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.5"> |
|||
|
|||
<ImageView |
|||
android:layout_height="wrap_content" |
|||
android:scaleType="centerCrop" |
|||
app:srcCompat="@mipmap/mail" |
|||
android:layout_centerVertical="true" |
|||
android:layout_centerHorizontal="true" |
|||
android:id="@+id/imageView2" |
|||
android:layout_width="wrap_content"/> |
|||
|
|||
|
|||
<GridLayout |
|||
android:orientation="vertical" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginBottom="36dp" |
|||
android:layout_marginLeft="100dp" |
|||
android:layout_alignParentBottom="true"> |
|||
|
|||
<TextView |
|||
android:text="Выберите подписки" |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:id="@+id/textView2" |
|||
android:textAppearance="@style/TextAppearance.AppCompat.Button" |
|||
android:textSize="18sp" |
|||
android:layout_marginLeft="20dp"/> |
|||
|
|||
<TextView |
|||
android:text="Кажется, что вы впервые в этом приложение, а значит нам нужно узнать, что вам интересно." |
|||
android:layout_width="wrap_content" |
|||
android:layout_height="wrap_content" |
|||
android:layout_marginTop="10dp" |
|||
android:layout_marginRight="10dp" |
|||
android:id="@+id/textView6" |
|||
android:textAppearance="@style/TextAppearance.AppCompat.Caption" /> |
|||
</GridLayout> |
|||
|
|||
</RelativeLayout> |
|||
|
|||
<ListView |
|||
android:layout_width="match_parent" |
|||
android:layout_height="0dp" |
|||
android:layout_weight="0.5" |
|||
android:layout_alignParentTop="true" |
|||
android:layout_centerHorizontal="true" |
|||
android:id="@+id/subsList"/> |
|||
|
|||
</LinearLayout> |
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto"> |
|||
<item |
|||
android:id="@+id/action_settings" |
|||
android:orderInCategory="100" |
|||
android:title="@string/action_settings" |
|||
app:showAsAction="never" /> |
|||
</menu> |
@ -0,0 +1,45 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
|
|||
<group android:checkableBehavior="single"> |
|||
<item |
|||
android:id="@+id/nav_newsfeed" |
|||
android:icon="@android:drawable/ic_input_get" |
|||
android:title="@string/nav_newsfeed" /> |
|||
<item |
|||
android:id="@+id/nav_profile" |
|||
android:icon="@android:drawable/ic_input_get" |
|||
android:title="@string/nav_student_profile" /> |
|||
<item |
|||
android:id="@+id/nav_schedule" |
|||
android:icon="@android:drawable/ic_input_get" |
|||
android:title="@string/nav_shedule" /> |
|||
<item |
|||
android:id="@+id/nav_journal" |
|||
android:icon="@android:drawable/ic_menu_sort_alphabetically" |
|||
android:title="@string/nav_gradebook" /> |
|||
<item |
|||
android:id="@+id/nav_grouprate" |
|||
android:icon="@drawable/abc_ic_star_half_black_36dp" |
|||
android:title="@string/nav_group_rating" /> |
|||
<item |
|||
android:id="@+id/nav_facultyrate" |
|||
android:icon="@drawable/abc_ic_star_black_36dp" |
|||
android:title="@string/nav_faculty_rating" /> |
|||
</group> |
|||
<item android:title="@string/web_drawer_others" > |
|||
<menu> |
|||
<group android:checkableBehavior="single"> |
|||
<item |
|||
android:id="@+id/nav_aboutapp" |
|||
android:icon="@drawable/ic_menu_send" |
|||
android:title="@string/nav_add_about_devs"/> |
|||
<item |
|||
android:id="@+id/nav_changeacc" |
|||
android:icon="@android:drawable/ic_menu_set_as" |
|||
android:title="@string/nav_add_log_out"/> |
|||
</group> |
|||
</menu> |
|||
</item> |
|||
|
|||
</menu> |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<string name="app_name">TSTU Student App</string> |
|||
<string name="progress_content">Updating data</string> |
|||
<string name="creator">Defend Development 2017</string> |
|||
<string name="action_settings">Settings</string> |
|||
<string name="navigation_drawer_close">Close navigation drawer</string> |
|||
<string name="navigation_drawer_open">Open navigation drawer</string> |
|||
<string name="about_title">Application \"TSTU Student App\" Alpha 1</string> |
|||
<string name="about_content">This application have only education targets and have no any commercial profit. You can find out more about app on this site: \"http://defend.pw/</string> |
|||
<string name="title_activity_web">Cabinet</string> |
|||
<string name="hint_password">Student password</string> |
|||
<string name="hint_login">Student login</string> |
|||
<string name="checkbox_remember_user">Remember me</string> |
|||
<string name="student_surname_name">Student surname/name</string> |
|||
<string name="app_log_in">Log In</string> |
|||
<string name="title_profile">Your profile</string> |
|||
<string name="title_newsfeed">News feed</string> |
|||
<string name="title_journal">Gradebook</string> |
|||
<string name="title_grouprate">Group rating</string> |
|||
<string name="title_about_dev">About developers</string> |
|||
<string name="title_globalrate">Faculty rating</string> |
|||
<string name="web_drawer_others">Other</string> |
|||
<string name="nav_shedule">Shedule</string> |
|||
<string name="nav_newsfeed">News Feed</string> |
|||
<string name="nav_group_rating">Group Rating</string> |
|||
<string name="nav_gradebook">Gradebook</string> |
|||
<string name="nav_student_profile">Profile</string> |
|||
<string name="nav_faculty_rating">Faculty Rating</string> |
|||
<string name="nav_add_about_devs">About developers</string> |
|||
<string name="nav_add_log_out">Log Out</string> |
|||
<string name="nav_header_title">TSTU Student App</string> |
|||
<string name="dev_site">http://defend.pw/</string> |
|||
</resources> |
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<string name="app_name">TSTU Student App</string> |
|||
<string name="about_content">Данное приложение имеет только образовательные цели и не нацелено на коммерческую выгоду. О судьбе приложения можно узнать на сайте http://defend.pw/</string> |
|||
<string name="about_title">Приложение \"TSTU Student App\" Альфа 1</string> |
|||
<string name="action_settings">Настройки</string> |
|||
<string name="creator">Defend Development 2017</string> |
|||
<string name="navigation_drawer_close">Закрыть панель навигации</string> |
|||
<string name="navigation_drawer_open">Открыть панель навигации</string> |
|||
<string name="progress_content">Обновляем данные</string> |
|||
<string name="title_activity_web">Кабинет</string> |
|||
<string name="hint_password">Пароль студента</string> |
|||
<string name="hint_login">Логин студента</string> |
|||
<string name="checkbox_remember_user">Запомнить меня</string> |
|||
<string name="student_surname_name">ФИО Студента</string> |
|||
<string name="app_log_in">Вход в кабинет</string> |
|||
<string name="title_profile">Твой профиль</string> |
|||
<string name="title_newsfeed">Новостная лента</string> |
|||
<string name="title_journal">Журнал оценок</string> |
|||
<string name="title_grouprate">Рейтинг в группе</string> |
|||
<string name="title_about_dev">О разработчиках</string> |
|||
<string name="title_globalrate">Рейтинг в институте</string> |
|||
<string name="web_drawer_others">Дополнительно</string> |
|||
<string name="nav_shedule">Расписание</string> |
|||
<string name="nav_newsfeed">Новостная лента</string> |
|||
<string name="nav_student_profile">Личный профиль</string> |
|||
<string name="nav_group_rating">Рейтинг в группе</string> |
|||
<string name="nav_gradebook">Журнал оценок</string> |
|||
<string name="nav_faculty_rating">Рейтинг в институте</string> |
|||
<string name="nav_add_about_devs">О разработчиках</string> |
|||
<string name="nav_add_log_out">Выйти из кабинета</string> |
|||
<string name="nav_header_title">TSTU Student App</string> |
|||
<string name="dev_site">http://defend.pw/</string> |
|||
</resources> |
@ -0,0 +1,9 @@ |
|||
<resources> |
|||
|
|||
<style name="AppTheme.NoActionBar"> |
|||
<item name="windowActionBar">false</item> |
|||
<item name="windowNoTitle">true</item> |
|||
<item name="android:windowDrawsSystemBarBackgrounds">true</item> |
|||
<item name="android:statusBarColor">@android:color/transparent</item> |
|||
</style> |
|||
</resources> |
@ -0,0 +1,6 @@ |
|||
<resources> |
|||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml |
|||
(such as screen margins) for screens with more than 820dp of available width. This |
|||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> |
|||
<dimen name="activity_horizontal_margin">64dp</dimen> |
|||
</resources> |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<resources> |
|||
<color name="colorPrimary">#3F51B5</color> |
|||
<color name="colorPrimaryDark">#303F9F</color> |
|||
<color name="colorAccent">#FF4081</color> |
|||
</resources> |
@ -0,0 +1,9 @@ |
|||
<resources> |
|||
<!-- Default screen margins, per the Android Design guidelines. --> |
|||
<dimen name="activity_horizontal_margin">16dp</dimen> |
|||
<dimen name="activity_vertical_margin">16dp</dimen> |
|||
<!-- Default screen margins, per the Android Design guidelines. --> |
|||
<dimen name="nav_header_vertical_spacing">16dp</dimen> |
|||
<dimen name="nav_header_height">160dp</dimen> |
|||
<dimen name="fab_margin">16dp</dimen> |
|||
</resources> |
@ -0,0 +1,8 @@ |
|||
<resources xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item name="ic_menu_camera" type="drawable">@android:drawable/ic_menu_camera</item> |
|||
<item name="ic_menu_gallery" type="drawable">@android:drawable/ic_menu_gallery</item> |
|||
<item name="ic_menu_slideshow" type="drawable">@android:drawable/ic_menu_slideshow</item> |
|||
<item name="ic_menu_manage" type="drawable">@android:drawable/ic_menu_manage</item> |
|||
<item name="ic_menu_share" type="drawable">@android:drawable/ic_menu_share</item> |
|||
<item name="ic_menu_send" type="drawable">@android:drawable/ic_menu_send</item> |
|||
</resources> |
@ -0,0 +1,37 @@ |
|||
<resources> |
|||
<string name="app_name">TSTU Student App</string> |
|||
<string name="title_activity_web">Кабинет</string> |
|||
|
|||
<string name="navigation_drawer_open">Открыть панель навигации</string> |
|||
<string name="navigation_drawer_close">Закрыть панель навигации</string> |
|||
|
|||
<string name="creator">Defend Development 2017</string> |
|||
<string name="about_title">Приложение TSTU Student App\nAlpha 1</string> |
|||
<string name="about_content">Данное приложение имеет только образовательные цели и не нацелено на коммерческую выгоду.\n |
|||
О судьбе приложения можно узнать на сайте http://defend.pw/</string> |
|||
<string name="progress_content">Обновляем данные =)</string> |
|||
|
|||
<string name="action_settings">Настройки</string> |
|||
<string name="hint_password">Пароль студента</string> |
|||
<string name="hint_login">Логин студента</string> |
|||
<string name="checkbox_remember_user">Запомнить меня</string> |
|||
<string name="student_surname_name">ФИО Студента</string> |
|||
<string name="app_log_in">Вход в кабинет</string> |
|||
<string name="title_profile">Твой профиль</string> |
|||
<string name="title_newsfeed">Новостная лента</string> |
|||
<string name="title_journal">Журнал оценок</string> |
|||
<string name="title_grouprate">Рейтинг в группе</string> |
|||
<string name="title_globalrate">Рейтинг в институте</string> |
|||
<string name="title_about_dev">О разработчиках</string> |
|||
<string name="web_drawer_others">Дополнительно</string> |
|||
<string name="nav_shedule">Расписание</string> |
|||
<string name="nav_student_profile">Личный профиль</string> |
|||
<string name="nav_newsfeed">Новостная лента</string> |
|||
<string name="nav_gradebook">Журнал оценок</string> |
|||
<string name="nav_group_rating">Рейтинг в группе</string> |
|||
<string name="nav_faculty_rating">Рейтинг в институте</string> |
|||
<string name="nav_add_about_devs">О разработчике</string> |
|||
<string name="nav_add_log_out">Выйти из кабинета</string> |
|||
<string name="nav_header_title">TSTU Студенческий Кабинет</string> |
|||
<string name="dev_site">http://defend.pw/</string> |
|||
</resources> |
@ -0,0 +1,21 @@ |
|||
<resources> |
|||
|
|||
<!-- Base application theme. --> |
|||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> |
|||
<!-- Customize your theme here. --> |
|||
<item name="colorPrimary">@color/colorPrimary</item> |
|||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> |
|||
<item name="colorAccent">@color/colorAccent</item> |
|||
</style> |
|||
|
|||
<style name="AppTheme.NoActionBar"> |
|||
<item name="windowActionBar">false</item> |
|||
<item name="windowNoTitle">true</item> |
|||
</style> |
|||
|
|||
|
|||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> |
|||
|
|||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> |
|||
|
|||
</resources> |
@ -0,0 +1,16 @@ |
|||
package ru.defend.defdevteam.tstu; |
|||
|
|||
import org.junit.Test; |
|||
|
|||
import static org.junit.Assert.*; |
|||
|
|||
/** |
|||
* Created by thedefend on 30.11.16. |
|||
*/ |
|||
public class FeedControllerTest { |
|||
|
|||
@Test |
|||
public void getRssString() throws Exception { |
|||
} |
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules. |
|||
|
|||
buildscript { |
|||
repositories { |
|||
jcenter() |
|||
} |
|||
dependencies { |
|||
classpath 'com.android.tools.build:gradle:2.2.3' |
|||
|
|||
// NOTE: Do not place your application dependencies here; they belong |
|||
// in the individual module build.gradle files |
|||
} |
|||
} |
|||
|
|||
allprojects { |
|||
repositories { |
|||
jcenter() |
|||
} |
|||
} |
|||
|
|||
task clean(type: Delete) { |
|||
delete rootProject.buildDir |
|||
} |
@ -0,0 +1,18 @@ |
|||
# Project-wide Gradle settings. |
|||
|
|||
# IDE (e.g. Android Studio) users: |
|||
# Gradle settings configured through the IDE *will override* |
|||
# any settings specified in this file. |
|||
|
|||
# For more details on how to configure your build environment visit |
|||
# http://www.gradle.org/docs/current/userguide/build_environment.html |
|||
|
|||
# Specifies the JVM arguments used for the daemon process. |
|||
# The setting is particularly useful for tweaking memory settings. |
|||
# Default value: -Xmx10248m -XX:MaxPermSize=256m |
|||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 |
|||
|
|||
# When configured, Gradle will run in incubating parallel mode. |
|||
# This option should only be used with decoupled projects. More details, visit |
|||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects |
|||
# org.gradle.parallel=true |
@ -0,0 +1,6 @@ |
|||
#Sat Oct 15 18:03:23 MSK 2016 |
|||
distributionBase=GRADLE_USER_HOME |
|||
distributionPath=wrapper/dists |
|||
zipStoreBase=GRADLE_USER_HOME |
|||
zipStorePath=wrapper/dists |
|||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip |
@ -0,0 +1,11 @@ |
|||
## This file is automatically generated by Android Studio. |
|||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! |
|||
# |
|||
# This file must *NOT* be checked into Version Control Systems, |
|||
# as it contains information specific to your local configuration. |
|||
# |
|||
# Location of the SDK. This is only used by Gradle. |
|||
# For customization when using a Version Control System, please read the |
|||
# header note. |
|||
#Tue Jan 24 17:32:36 MSK 2017 |
|||
sdk.dir=C\:\\Users\\itsmy\\AppData\\Local\\Android\\Sdk |
@ -0,0 +1 @@ |
|||
include ':app' |