Skip to content

Commit

Permalink
Updated env. Added icons in repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
meefik committed Apr 24, 2018
1 parent 8b9ca86 commit 3f9135a
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 15 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog (English)
===================

2.0.7
Fixed problem with seccomp (issue #869)
Improved Gentoo bootstrap

2.0.6
Improved mount and unmount functions
Force make a filesystem
Expand All @@ -11,7 +15,7 @@ Enabled journal for FS ext3/4, ext2 without journal
Added an attempt to re-unmount in case of failure
The e2fsck utility is included in the assembly
Fixed problem with running dbus in Fedora
Fixed issue of creating a FS (mke2fs) when using busybox from system (issue # 891)
Fixed issue of creating a FS (mke2fs) when using busybox from system (issue #891)
START and STOP buttons in notification
Show app after five taps on notification in stealth mode

Expand Down Expand Up @@ -396,6 +400,10 @@ Updated list packages of base system installation
История изменений (Русский)
===========================

2.0.7
Исправлена проблема с seccomp (тикет #869)
Доработан инсталлятор Gentoo

2.0.6
Изменен подход к монтированию и размонтированию контейнера
Исправление проблемы с созданием файловой системы
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '27.0.2'
buildToolsVersion '27.0.3'

defaultConfig {
applicationId 'ru.meefik.linuxdeploy'
minSdkVersion 10
targetSdkVersion 25
versionCode 234
versionName "2.0.6"
versionCode 235
versionName "2.0.7"
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/env
49 changes: 43 additions & 6 deletions app/src/main/java/ru/meefik/linuxdeploy/RepositoryActivity.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package ru.meefik.linuxdeploy;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
Expand All @@ -17,6 +20,7 @@
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -207,6 +211,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
dialog.show();
}

@SuppressLint("RestrictedApi")
private void changeUrlDialog() {
final EditText input = new EditText(this);
input.setText(PrefStore.getRepositoryUrl(this));
Expand Down Expand Up @@ -253,17 +258,49 @@ protected void onCreate(Bundle savedInstanceState) {
// ListView Adapter
ListView listView = (ListView) findViewById(R.id.repositoryView);
adapter = new ArrayAdapter<Map<String, String>>(this,
android.R.layout.simple_list_item_2, android.R.id.text1, profiles) {
R.layout.repository_row, R.id.repo_entry_title, profiles) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
TextView text1 = (TextView) view.findViewById(android.R.id.text1);
TextView text2 = (TextView) view.findViewById(android.R.id.text2);
TextView title = (TextView) view.findViewById(R.id.repo_entry_title);
TextView subTitle = (TextView) view.findViewById(R.id.repo_entry_subtitle);
ImageView icon = (ImageView) view.findViewById(R.id.repo_entry_icon);
String name = profiles.get(position).get("PROFILE");
String desc = profiles.get(position).get("DESC");
text1.setText(name);
if (desc != null && !desc.isEmpty()) text2.setText(desc);
else text2.setText(getString(R.string.repository_default_description));
String type = profiles.get(position).get("TYPE");
int iconRes = R.raw.linux;
switch (type) {
case "archlinux":
iconRes = R.raw.archlinux;
break;
case "centos":
iconRes = R.raw.centos;
break;
case "debian":
iconRes = R.raw.debian;
break;
case "fedora":
iconRes = R.raw.fedora;
break;
case "gentoo":
iconRes = R.raw.gentoo;
break;
case "kalilinux":
iconRes = R.raw.kalilinux;
break;
case "slackware":
iconRes = R.raw.slackware;
break;
case "ubuntu":
iconRes = R.raw.ubuntu;
break;
}
InputStream imageStream = view.getResources().openRawResource(iconRes);
Bitmap bitmap = BitmapFactory.decodeStream(imageStream);
icon.setImageBitmap(bitmap);
title.setText(name);
if (desc != null && !desc.isEmpty()) subTitle.setText(desc);
else subTitle.setText(getString(R.string.repository_default_description));
return view;
}
};
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/mounts_row.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
Expand Down
32 changes: 32 additions & 0 deletions app/src/main/res/layout/repository_row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ImageView
android:id="@+id/repo_entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:padding="10dp" />

<TextView
android:id="@+id/repo_entry_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/repo_entry_icon"
android:layout_alignTop="@id/repo_entry_icon"
android:layout_margin="6dp"
android:textSize="18sp"
android:textStyle="bold" />

<TextView
android:id="@+id/repo_entry_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/repo_entry_title"
android:layout_alignLeft="@id/repo_entry_title"
android:layout_marginBottom="10dp"
android:textSize="14sp" />

</RelativeLayout>
Binary file added app/src/main/res/raw/archlinux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/centos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/debian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/fedora.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/gentoo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/kalilinux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/slackware.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/raw/ubuntu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ buildscript {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Dec 22 15:45:26 MSK 2017
#Mon Apr 23 08:36:17 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 comments on commit 3f9135a

Please sign in to comment.