Skip to content

Commit 78a5aae

Browse files
committed
ffmpeg editor
1 parent 893bb81 commit 78a5aae

104 files changed

Lines changed: 5074 additions & 26 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PowerFileExplorer/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ dependencies{
8484
//compile 'com.android.support:customtabs:24.1.1'
8585
//compile 'com.android.support:palette-v7:24.1.1'
8686

87+
//compile 'com.android.support:support-v13:24.1.1'
88+
compile 'com.android.support:appcompat-v7:24.1.1'
89+
compile 'com.android.support:support-v4:24.1.1'
90+
8791
compile 'eu.chainfire:libsuperuser:1.0.0.+'
8892
compile ('com.afollestad.material-dialogs:core:0.9.2.3') {
8993
transitive = false
9094
}
9195
compile 'com.cloudrail:cloudrail-si-android:2.22.2'
9296
compile 'com.google.android.exoplayer:exoplayer:r2.3.1'
93-
//compile ('org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0') {
94-
// transitive = false
95-
//}
96-
97-
//compile 'com.android.support:support-v13:24.1.1'
98-
compile 'com.android.support:appcompat-v7:24.1.1'
99-
compile 'com.android.support:support-v4:24.1.1'
97+
compile ('org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0') {
98+
transitive = false
99+
}
100100

101101
//support-v4
102102
//compile 'com.android.support:support-compat:25.3.1'
31.7 KB
Binary file not shown.

PowerFileExplorer/src/main/AndroidManifest.xml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
44
package="net.gnu.explorer"
55
android:versionCode="2"
6-
android:versionName="1.0.2"
6+
android:versionName="1.0.3"
77
>
88

99
<!-- Min/target SDK versions (<uses-sdk>) managed by build.gradle
@@ -298,8 +298,7 @@
298298

299299
<activity
300300
android:name="net.gnu.mupdf.viewer.DocumentActivity"
301-
android:label="PDF Reader"
302-
>
301+
android:label="PDF Reader">
303302
<intent-filter>
304303
<action android:name="android.intent.action.VIEW" />
305304
<category android:name="android.intent.category.DEFAULT" />
@@ -325,19 +324,42 @@
325324
</activity>
326325
<activity
327326
android:name="net.gnu.mupdf.viewer.OutlineActivity"
328-
android:configChanges="orientation|screenSize|keyboardHidden"
329-
>
327+
android:configChanges="orientation|screenSize|keyboardHidden">
330328
</activity>
331329
<activity
332330
android:name="net.gnu.mupdf.viewer.app.LibraryActivity"
333-
android:configChanges="orientation|screenSize|keyboardHidden"
334-
>
331+
android:configChanges="orientation|screenSize|keyboardHidden">
335332
<intent-filter>
336333
<action android:name="android.intent.action.MAIN" />
337334
<category android:name="android.intent.category.DEFAULT" />
338335
</intent-filter>
339336
</activity>
340337

338+
<activity android:name="com.tuarua.avane.android.libavaneexample.MainActivity"
339+
android:label="Ffmpeg utilities">
340+
<intent-filter>
341+
<action android:name="android.intent.action.MAIN" />
342+
<category android:name="android.intent.category.LAUNCHER" />
343+
</intent-filter>
344+
</activity>
345+
346+
<activity android:name="videoeditor.bhuvnesh.com.ffmpegvideoeditor.activity.MainActivity"
347+
android:screenOrientation="portrait">
348+
<intent-filter>
349+
<action android:name="android.intent.action.MAIN" />
350+
<category android:name="android.intent.category.LAUNCHER" />
351+
</intent-filter>
352+
</activity>
353+
<activity android:name="videoeditor.bhuvnesh.com.ffmpegvideoeditor.activity.PreviewActivity"
354+
android:screenOrientation="portrait">
355+
</activity>
356+
<activity android:name="videoeditor.bhuvnesh.com.ffmpegvideoeditor.activity.PreviewImageActivity"
357+
android:screenOrientation="portrait">
358+
</activity>
359+
<activity android:name="videoeditor.bhuvnesh.com.ffmpegvideoeditor.activity.AudioPreviewActivity"
360+
android:screenOrientation="portrait">
361+
</activity>
362+
341363
<!--<receiver android:name="com.commonsware.android.sysevents.boot.OnBootReceiver">
342364
<intent-filter>
343365
<action android:name="android.intent.action.BOOT_COMPLETED"/>
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
/*
2+
* Copyright 2013 Leon Cheng
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.lylc.widget.circularprogressbar;
18+
19+
import android.animation.Animator;
20+
import android.animation.Animator.AnimatorListener;
21+
import android.animation.ObjectAnimator;
22+
import android.animation.ValueAnimator;
23+
import android.animation.ValueAnimator.AnimatorUpdateListener;
24+
import android.content.Context;
25+
import android.content.res.Resources;
26+
import android.content.res.TypedArray;
27+
import android.graphics.Canvas;
28+
import android.graphics.Color;
29+
import android.graphics.Paint;
30+
import android.graphics.Paint.Style;
31+
import android.graphics.RectF;
32+
import android.graphics.Typeface;
33+
import android.text.TextUtils;
34+
import android.util.AttributeSet;
35+
import android.view.View;
36+
import android.view.animation.LinearInterpolator;
37+
import android.widget.ProgressBar;
38+
import net.gnu.explorer.R;
39+
40+
public class CircularProgressBar extends ProgressBar{
41+
private static final String TAG = "CircularProgressBar";
42+
43+
private static final int STROKE_WIDTH = 20;
44+
45+
private String mTitle = "";
46+
private String mSubTitle = "";
47+
48+
private int mStrokeWidth = STROKE_WIDTH;
49+
50+
private final RectF mCircleBounds = new RectF();
51+
52+
private final Paint mProgressColorPaint = new Paint();
53+
private final Paint mBackgroundColorPaint = new Paint();
54+
private final Paint mTitlePaint = new Paint();
55+
private final Paint mSubtitlePaint = new Paint();
56+
57+
private boolean mHasShadow = true;
58+
private int mShadowColor = Color.BLACK;
59+
60+
public interface ProgressAnimationListener{
61+
public void onAnimationStart();
62+
public void onAnimationFinish();
63+
public void onAnimationProgress(int progress);
64+
}
65+
66+
public CircularProgressBar(Context context) {
67+
super(context);
68+
init(null, 0);
69+
}
70+
71+
public CircularProgressBar(Context context, AttributeSet attrs) {
72+
super(context, attrs);
73+
init(attrs, 0);
74+
}
75+
76+
public CircularProgressBar(Context context, AttributeSet attrs, int defStyle) {
77+
super(context, attrs, defStyle);
78+
init(attrs, defStyle);
79+
}
80+
81+
public void init(AttributeSet attrs, int style){
82+
//so that shadow shows up properly for lines and arcs
83+
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
84+
85+
TypedArray a = getContext().obtainStyledAttributes(attrs,
86+
R.styleable.CircularProgressBar, style, 0);
87+
88+
String color;
89+
Resources res = getResources();
90+
91+
this.mHasShadow = a.getBoolean(R.styleable.CircularProgressBar_cpb_hasShadow, true);
92+
93+
color = a.getString(R.styleable.CircularProgressBar_cpb_progressColor);
94+
if(color==null)
95+
mProgressColorPaint.setColor(res.getColor(R.color.circular_progress_default_progress));
96+
else
97+
mProgressColorPaint.setColor(Color.parseColor(color));
98+
99+
color = a.getString(R.styleable.CircularProgressBar_cpb_backgroundColor);
100+
if(color==null)
101+
mBackgroundColorPaint.setColor(res.getColor(R.color.circular_progress_default_background));
102+
else
103+
mBackgroundColorPaint.setColor(Color.parseColor(color));
104+
105+
color = a.getString(R.styleable.CircularProgressBar_cpb_titleColor);
106+
if(color==null)
107+
mTitlePaint.setColor(res.getColor(R.color.circular_progress_default_title));
108+
else
109+
mTitlePaint.setColor(Color.parseColor(color));
110+
111+
color = a.getString(R.styleable.CircularProgressBar_cpb_subtitleColor);
112+
if(color==null)
113+
mSubtitlePaint.setColor(res.getColor(R.color.circular_progress_default_subtitle));
114+
else
115+
mSubtitlePaint.setColor(Color.parseColor(color));
116+
117+
118+
String t = a.getString(R.styleable.CircularProgressBar_cpb_title);
119+
if(t!=null)
120+
mTitle = t;
121+
122+
t = a.getString(R.styleable.CircularProgressBar_cpb_subtitle);
123+
if(t!=null)
124+
mSubTitle = t;
125+
126+
mStrokeWidth = a.getInt(R.styleable.CircularProgressBar_cpb_strokeWidth, STROKE_WIDTH);
127+
128+
a.recycle();
129+
130+
131+
mProgressColorPaint.setAntiAlias(true);
132+
mProgressColorPaint.setStyle(Paint.Style.STROKE);
133+
mProgressColorPaint.setStrokeWidth(mStrokeWidth);
134+
135+
mBackgroundColorPaint.setAntiAlias(true);
136+
mBackgroundColorPaint.setStyle(Paint.Style.STROKE);
137+
mBackgroundColorPaint.setStrokeWidth(mStrokeWidth);
138+
139+
mTitlePaint.setTextSize(60);
140+
mTitlePaint.setStyle(Style.FILL);
141+
mTitlePaint.setAntiAlias(true);
142+
mTitlePaint.setTypeface(Typeface.create("Roboto-Thin", Typeface.NORMAL));
143+
mTitlePaint.setShadowLayer(0.1f, 0, 1, Color.GRAY);
144+
145+
mSubtitlePaint.setTextSize(30);
146+
mSubtitlePaint.setStyle(Style.FILL);
147+
mSubtitlePaint.setAntiAlias(true);
148+
mSubtitlePaint.setTypeface(Typeface.create("Roboto-Thin", Typeface.BOLD));
149+
// mSubtitlePaint.setShadowLayer(0.1f, 0, 1, Color.GRAY);
150+
}
151+
152+
@Override
153+
protected synchronized void onDraw(Canvas canvas) {
154+
canvas.drawArc(mCircleBounds, 0, 360 , false, mBackgroundColorPaint);
155+
156+
int prog = getProgress();
157+
float scale = getMax() > 0 ? (float)prog/getMax() *360: 0;
158+
159+
if(mHasShadow)
160+
mProgressColorPaint.setShadowLayer( 3, 0, 1, mShadowColor);
161+
canvas.drawArc(mCircleBounds, 270, scale , false, mProgressColorPaint);
162+
163+
164+
if(!TextUtils.isEmpty(mTitle)){
165+
int xPos = (int)(getMeasuredWidth()/2 - mTitlePaint.measureText(mTitle) / 2);
166+
int yPos = (int) (getMeasuredHeight()/2);
167+
168+
float titleHeight = Math.abs(mTitlePaint.descent() + mTitlePaint.ascent());
169+
if(TextUtils.isEmpty(mSubTitle)){
170+
yPos += titleHeight/2;
171+
}
172+
canvas.drawText(mTitle, xPos, yPos, mTitlePaint);
173+
174+
yPos += titleHeight;
175+
xPos = (int)(getMeasuredWidth()/2 - mSubtitlePaint.measureText(mSubTitle) / 2);
176+
177+
canvas.drawText(mSubTitle, xPos, yPos, mSubtitlePaint);
178+
}
179+
180+
super.onDraw(canvas);
181+
}
182+
183+
@Override
184+
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
185+
final int height = getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec);
186+
final int width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
187+
final int min = Math.min(width, height);
188+
setMeasuredDimension(min+2*STROKE_WIDTH, min+2*STROKE_WIDTH);
189+
190+
mCircleBounds.set(STROKE_WIDTH, STROKE_WIDTH, min+STROKE_WIDTH, min+STROKE_WIDTH);
191+
}
192+
193+
@Override
194+
public synchronized void setProgress(int progress) {
195+
super.setProgress(progress);
196+
197+
// the setProgress super will not change the details of the progress bar
198+
// anymore so we need to force an update to redraw the progress bar
199+
invalidate();
200+
}
201+
202+
public void animateProgressTo(final int start, final int end, final ProgressAnimationListener listener){
203+
if(start!=0)
204+
setProgress(start);
205+
206+
final ObjectAnimator progressBarAnimator = ObjectAnimator.ofFloat(this, "animateProgress", start, end);
207+
progressBarAnimator.setDuration(1500);
208+
// progressBarAnimator.setInterpolator(new AnticipateOvershootInterpolator(2f, 1.5f));
209+
progressBarAnimator.setInterpolator(new LinearInterpolator());
210+
211+
progressBarAnimator.addListener(new AnimatorListener() {
212+
@Override
213+
public void onAnimationCancel(final Animator animation) {
214+
}
215+
216+
@Override
217+
public void onAnimationEnd(final Animator animation) {
218+
CircularProgressBar.this.setProgress(end);
219+
if(listener!=null)
220+
listener.onAnimationFinish();
221+
}
222+
223+
@Override
224+
public void onAnimationRepeat(final Animator animation) {
225+
}
226+
227+
@Override
228+
public void onAnimationStart(final Animator animation) {
229+
if(listener!=null)
230+
listener.onAnimationStart();
231+
}
232+
});
233+
234+
progressBarAnimator.addUpdateListener(new AnimatorUpdateListener() {
235+
@Override
236+
public void onAnimationUpdate(final ValueAnimator animation) {
237+
int progress = ((Float) animation.getAnimatedValue()).intValue();
238+
if(progress!=CircularProgressBar.this.getProgress()){
239+
CircularProgressBar.this.setProgress(progress);
240+
if(listener!=null)
241+
listener.onAnimationProgress(progress);
242+
}
243+
}
244+
});
245+
progressBarAnimator.start();
246+
}
247+
248+
public synchronized void setTitle(String title){
249+
this.mTitle = title;
250+
invalidate();
251+
}
252+
253+
public synchronized void setSubTitle(String subtitle){
254+
this.mSubTitle = subtitle;
255+
invalidate();
256+
}
257+
258+
public synchronized void setSubTitleColor(int color){
259+
mSubtitlePaint.setColor(color);
260+
invalidate();
261+
}
262+
263+
public synchronized void setTitleColor(int color){
264+
mTitlePaint.setColor(color);
265+
invalidate();
266+
}
267+
268+
public synchronized void setHasShadow(boolean flag){
269+
this.mHasShadow = flag;
270+
invalidate();
271+
}
272+
273+
public synchronized void setShadow(int color){
274+
this.mShadowColor = color;
275+
invalidate();
276+
}
277+
278+
public String getTitle(){
279+
return mTitle;
280+
}
281+
282+
public boolean getHasShadow(){
283+
return mHasShadow;
284+
}
285+
}

0 commit comments

Comments
 (0)