Skip to content

Commit

Permalink
remove chart_describe_activity
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiếu Trần Trung committed Dec 31, 2019
1 parent 753c5e8 commit ca66f6f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 112 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
android:name=".activities.StatisticPieChart"
android:label="@string/statistic_title"
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".activities.ChartDescribeActivity" />
<activity
android:name=".activities.ProjectActivity"
android:label="@string/title_activity_project"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.ArrayList;
import java.util.UUID;

public class ProjectFileManager {
public class FileManager {

public static final String DEFAULT_FOLDER = "ChartProjects";
private ArrayList<ProjectLocation> result;
Expand Down Expand Up @@ -195,7 +195,6 @@ public static ArrayList<Pair<ChartLocation, Chart>> loadCharts(final ProjectLoca
}

public static void saveChart(final ProjectLocation projectLocation, final Chart chart, final ChartLocation chartLocation) {

File projectFolder = new File(projectLocation.getLocation()).getParentFile();
File file = new File(projectFolder, chartLocation.getLocation());
Gson gson = new Gson();
Expand All @@ -213,18 +212,34 @@ public static void saveChart(final ProjectLocation projectLocation, final Chart
}
}

public static File saveImage(Context context, View view1, View view2) {
public static File saveTempImage(View view1, View view2) {
File sdcard = Environment.getExternalStorageDirectory();
File mainDir = new File(sdcard, DEFAULT_FOLDER);
String filename = UUID.randomUUID().toString().replace('-', '_');
File sFile = new File(mainDir, filename.concat(".png"));
//Bitmap bmp = createBitmapFromView(context, view);
Bitmap bmp1 = getBitmapFromView(view1);
Bitmap bmp2 = getBitmapFromView(view2);
Bitmap bmp = merge2Bitmap(bmp1, bmp2);
try (FileOutputStream out = new FileOutputStream(sFile)) {
bmp.compress(Bitmap.CompressFormat.PNG, 100, out); // bmp is your Bitmap instance
// PNG is a lossless format, the compression factor (100) is ignored
bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (IOException e) {
e.printStackTrace();
}
return sFile;
}

public static File saveImage(View view1, View view2, String imageName) {
File sdcard = Environment.getExternalStorageDirectory();
File mainDir = new File(sdcard, "Pictures/Charts");
if (!mainDir.exists()) {
mainDir.mkdirs();
}
File sFile = new File(mainDir, imageName.concat(".png"));
Bitmap bmp1 = getBitmapFromView(view1);
Bitmap bmp2 = getBitmapFromView(view2);
Bitmap bmp = merge2Bitmap(bmp1, bmp2);
try (FileOutputStream out = new FileOutputStream(sFile)) {
bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

This file was deleted.

15 changes: 0 additions & 15 deletions app/src/main/res/layout/activity_chart_describe.xml

This file was deleted.

28 changes: 0 additions & 28 deletions app/src/main/res/layout/legend_table_row.xml

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
<string name="default_object_meaning">Nước</string>

<string name="add_item">Thêm đối tượng</string>
<string name="add_serie">Thêm giai đoạn</string>
<string name="add_serial">Thêm giai đoạn</string>
<string name="add_serial">Thêm mốc</string>
<string name="apply">Áp dụng</string>
<string name="data_table">Bảng dữ liệu</string>
<string name="create_chart">Tạo biểu đồ</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<item name="android:windowDisablePreview">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"></style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"></style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="AppTheme.BottomSheetDialog" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<item name="enforceMaterialTheme">true</item>
Expand Down

0 comments on commit ca66f6f

Please sign in to comment.