|
|
@ -144,16 +144,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
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); |
|
|
@ -161,8 +151,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
|
|
|
|
MainA = getIntent(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
browser = (WebView) findViewById(R.id.webView); |
|
|
|
browser.setWebViewClient(new MyWebViewClient()); |
|
|
|
browserSet = browser.getSettings(); |
|
|
@ -187,7 +175,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
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"; |
|
|
@ -276,18 +263,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
@ -455,6 +430,10 @@ public class WebActivity extends AppCompatActivity |
|
|
|
groupList.setAdapter(groupL); |
|
|
|
} |
|
|
|
|
|
|
|
public void fillGroup(ArrayList<groupList> group){ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void fillFaculty(){ |
|
|
|
faculty = new ArrayList<groupList>(); |
|
|
|
String n,r; |
|
|
@ -480,7 +459,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//TODO: Переделать к хуям позор ниже
|
|
|
|
public void fillAll(){ |
|
|
|
String s; |
|
|
|
String s2 = GroupRateHTML; |
|
|
@ -508,14 +486,6 @@ public class WebActivity extends AppCompatActivity |
|
|
|
positionFaculty.setText("Место в институте: " + s2); |
|
|
|
} |
|
|
|
|
|
|
|
public void buttonRefresh (View v) { |
|
|
|
getHTML(); |
|
|
|
} |
|
|
|
|
|
|
|
public void buttonLogout (View v) { |
|
|
|
finish(); |
|
|
|
} |
|
|
|
|
|
|
|
@TargetApi(19) |
|
|
|
public void getHTML(){ |
|
|
|
|
|
|
@ -532,7 +502,7 @@ public class WebActivity extends AppCompatActivity |
|
|
|
|
|
|
|
public void encodeHTML(){ |
|
|
|
if(siteBuf != null){ |
|
|
|
siteBuf = removeUTFCharacters(siteBuf).toString(); |
|
|
|
siteBuf = OldParser.removeUTFCharacters(siteBuf).toString(); |
|
|
|
Log.d("Response html","Загружена страница "+cutLine("<title>","</title>",siteBuf)); |
|
|
|
Log.i("encodeHTML",siteBuf); |
|
|
|
} |
|
|
|