-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from Johnny1994/dev
Release v3.0.0
- Loading branch information
Showing
85 changed files
with
805 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+497 KB
...emo/app/libs/pldroid-shortvideo-2.2.1.jar → ...emo/app/libs/pldroid-shortvideo-3.0.0.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
...oDemo/app/src/main/java/com/qiniu/pili/droid/shortvideo/demo/activity/ConfigActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
package com.qiniu.pili.droid.shortvideo.demo.activity; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.AdapterView; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.Spinner; | ||
|
||
import com.qiniu.pili.droid.shortvideo.demo.R; | ||
import com.qiniu.pili.droid.shortvideo.demo.utils.RecordSettings; | ||
|
||
public class ConfigActivity extends AppCompatActivity { | ||
|
||
private Spinner mPreviewSizeRatioSpinner; | ||
private Spinner mPreviewSizeLevelSpinner; | ||
private Spinner mEncodingModeLevelSpinner; | ||
private Spinner mEncodingSizeLevelSpinner; | ||
private Spinner mEncodingBitrateLevelSpinner; | ||
private Spinner mAudioChannelNumSpinner; | ||
|
||
public static int PREVIEW_SIZE_RATIO_POS = 0; | ||
public static int PREVIEW_SIZE_LEVEL_POS = 3; | ||
public static int ENCODING_MODE_LEVEL_POS = 0; | ||
public static int ENCODING_SIZE_LEVEL_POS = 7; | ||
public static int ENCODING_BITRATE_LEVEL_POS = 2; | ||
public static int AUDIO_CHANNEL_NUM_POS = 0; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_config); | ||
|
||
mPreviewSizeRatioSpinner = (Spinner) findViewById(R.id.PreviewSizeRatioSpinner); | ||
mPreviewSizeLevelSpinner = (Spinner) findViewById(R.id.PreviewSizeLevelSpinner); | ||
mEncodingModeLevelSpinner = (Spinner) findViewById(R.id.EncodingModeLevelSpinner); | ||
mEncodingSizeLevelSpinner = (Spinner) findViewById(R.id.EncodingSizeLevelSpinner); | ||
mEncodingBitrateLevelSpinner = (Spinner) findViewById(R.id.EncodingBitrateLevelSpinner); | ||
mAudioChannelNumSpinner = (Spinner) findViewById(R.id.AudioChannelNumSpinner); | ||
|
||
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_RATIO_TIPS_ARRAY); | ||
mPreviewSizeRatioSpinner.setAdapter(adapter); | ||
mPreviewSizeRatioSpinner.setSelection(PREVIEW_SIZE_RATIO_POS); | ||
mPreviewSizeRatioSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
PREVIEW_SIZE_RATIO_POS = position; | ||
} | ||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) {} | ||
}); | ||
|
||
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_LEVEL_TIPS_ARRAY); | ||
mPreviewSizeLevelSpinner.setAdapter(adapter); | ||
mPreviewSizeLevelSpinner.setSelection(PREVIEW_SIZE_LEVEL_POS); | ||
mPreviewSizeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
PREVIEW_SIZE_LEVEL_POS = position; | ||
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) { | ||
|
||
} | ||
}); | ||
|
||
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_MODE_LEVEL_TIPS_ARRAY); | ||
mEncodingModeLevelSpinner.setAdapter(adapter); | ||
mEncodingModeLevelSpinner.setSelection(ENCODING_MODE_LEVEL_POS); | ||
mEncodingModeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
ENCODING_MODE_LEVEL_POS = position; | ||
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) { | ||
|
||
} | ||
}); | ||
|
||
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_SIZE_LEVEL_TIPS_ARRAY); | ||
mEncodingSizeLevelSpinner.setAdapter(adapter); | ||
mEncodingSizeLevelSpinner.setSelection(ENCODING_SIZE_LEVEL_POS); | ||
mEncodingSizeLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
ENCODING_SIZE_LEVEL_POS = position; | ||
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) { | ||
|
||
} | ||
}); | ||
|
||
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_BITRATE_LEVEL_TIPS_ARRAY); | ||
mEncodingBitrateLevelSpinner.setAdapter(adapter); | ||
mEncodingBitrateLevelSpinner.setSelection(ENCODING_BITRATE_LEVEL_POS); | ||
mEncodingBitrateLevelSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
ENCODING_BITRATE_LEVEL_POS = position; | ||
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) { | ||
|
||
} | ||
}); | ||
|
||
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.AUDIO_CHANNEL_NUM_TIPS_ARRAY); | ||
mAudioChannelNumSpinner.setAdapter(adapter); | ||
mAudioChannelNumSpinner.setSelection(AUDIO_CHANNEL_NUM_POS); | ||
mAudioChannelNumSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { | ||
@Override | ||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { | ||
AUDIO_CHANNEL_NUM_POS = position; | ||
} | ||
|
||
@Override | ||
public void onNothingSelected(AdapterView<?> parent) { | ||
|
||
} | ||
}); | ||
} | ||
|
||
public void onClickBack(View view) { | ||
finish(); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...pp/src/main/java/com/qiniu/pili/droid/shortvideo/demo/activity/ImportAndEditActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.qiniu.pili.droid.shortvideo.demo.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Build; | ||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
|
||
import com.qiniu.pili.droid.shortvideo.demo.R; | ||
import com.qiniu.pili.droid.shortvideo.demo.utils.PermissionChecker; | ||
import com.qiniu.pili.droid.shortvideo.demo.utils.ToastUtils; | ||
|
||
public class ImportAndEditActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_import_and_edit); | ||
} | ||
|
||
public void onClickImport(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(VideoTrimActivity.class); | ||
} | ||
} | ||
|
||
public void onClickTransitionMake(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(VideoDivideActivity.class); | ||
} | ||
} | ||
|
||
public void onClickVideoCompose(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(VideoComposeActivity.class); | ||
} | ||
} | ||
|
||
public void onClickTranscode(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(VideoTranscodeActivity.class); | ||
} | ||
} | ||
|
||
public void onClickMultipleCompose(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(MultipleComposeActivity.class); | ||
} | ||
} | ||
|
||
public void onClickExternalMediaRecord(View v) { | ||
if (isPermissionOK()) { | ||
jumpToActivity(ExternalMediaRecordActivity.class); | ||
} | ||
} | ||
|
||
private boolean isPermissionOK() { | ||
PermissionChecker checker = new PermissionChecker(this); | ||
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checker.checkPermission(); | ||
if (!isPermissionOK) { | ||
ToastUtils.s(this, "Some permissions is not approved !!!"); | ||
} | ||
return isPermissionOK; | ||
} | ||
|
||
private void jumpToActivity(Class<?> cls) { | ||
Intent intent = new Intent(ImportAndEditActivity.this, cls); | ||
startActivity(intent); | ||
} | ||
|
||
public void onClickBack(View view) { | ||
finish(); | ||
} | ||
} |
Oops, something went wrong.