Permalink
Browse files

Merge branch 'master' of https://github.com/BearWare/TeamTalk5

  • Loading branch information...
bear101 committed Nov 3, 2017
2 parents ee2b0bc + d2f6294 commit fda6e0f31338026e4d2f12d767fa27fb17a4ce99
@@ -45,14 +45,14 @@ android {
dependencies {
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:support-v13:23.4.0'
compile files('libs/TeamTalk5.jar')
// Required -- JUnit 4 framework
testCompile 'junit:junit:4.12'
testCompile files('libs/TeamTalk5Test.jar')
androidTestCompile 'com.android.support:support-annotations:25.3.1'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
// Optional -- Hamcrest library
@@ -4,6 +4,39 @@
android:versionCode="66"
android:versionName="5.2.4" >
<!-- RECORD_AUDIO is needed to create an audio recorder -->
<uses-permission android:name="android.permission.RECORD_AUDIO" >
</uses-permission>
<!-- MODIFY_AUDIO_SETTINGS is needed to use audio effects such as environmental reverb -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" >
</uses-permission>
<!--
INTERNET is needed to use a URI-based audio player, depending
on the URI
-->
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<!-- VIBRATE is needed to vibrate on up/down of tx button -->
<uses-permission android:name="android.permission.VIBRATE" >
</uses-permission>
<!-- READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are needed for file transfer facilities -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<!-- WAKE_LOCK is needed to keep connection alive when screen dims out -->
<uses-permission android:name="android.permission.WAKE_LOCK" >
</uses-permission>
<!-- READ_PHONE_STATE is needed to suspend on incoming call -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<application
android:icon="@drawable/teamtalk_blue"
android:label="@string/app_name"
@@ -74,37 +107,4 @@
</receiver>
</application>
<!-- RECORD_AUDIO is needed to create an audio recorder -->
<uses-permission android:name="android.permission.RECORD_AUDIO" >
</uses-permission>
<!-- MODIFY_AUDIO_SETTINGS is needed to use audio effects such as environmental reverb -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" >
</uses-permission>
<!--
INTERNET is needed to use a URI-based audio player, depending
on the URI
-->
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<!-- VIBRATE is needed to vibrate on up/down of tx button -->
<uses-permission android:name="android.permission.VIBRATE" >
</uses-permission>
<!-- READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are needed for file transfer facilities -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<!-- WAKE_LOCK is needed to keep connection alive when screen dims out -->
<uses-permission android:name="android.permission.WAKE_LOCK" >
</uses-permission>
<!-- READ_PHONE_STATE is needed to suspend on incoming call -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
</manifest>
@@ -57,6 +57,7 @@
import dk.bearware.gui.MainActivity;
import dk.bearware.gui.R;
import dk.bearware.gui.Utils;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@@ -65,6 +66,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Binder;
import android.os.Build;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.IBinder;
@@ -179,6 +181,7 @@ private String getNotificationText() {
ttserver.servername;
}
@SuppressLint("NewApi")
private void displayNotification(boolean enabled) {
if (enabled) {
final int UI_WIDGET_ID = 1;
@@ -190,9 +193,10 @@ private void displayNotification(boolean enabled) {
.setContentTitle(getString(R.string.app_name))
.setContentIntent(PendingIntent.getActivity(this, 0, ui, PendingIntent.FLAG_UPDATE_CURRENT))
.setOngoing(true)
.setShowWhen(false)
.setAutoCancel(false)
.setContentText(getNotificationText());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
widget.setShowWhen(false);
startForeground(UI_WIDGET_ID, widget.build());
} else {
((NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE)).notify(UI_WIDGET_ID, widget.setContentText(getNotificationText()).build());
@@ -318,7 +318,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
switch (getItemViewType(position)) {
case REMOTE_FILE_VIEW_TYPE: {
if((convertView == null) || (convertView.findViewById(R.id.fileinfo) == null))
convertView = inflater.inflate(R.layout.item_remote_file, null);
convertView = inflater.inflate(R.layout.item_remote_file, parent, false);
((TextView)convertView.findViewById(R.id.fileinfo)).setText(String.format("%d (%s)", remoteFile.nFileSize, remoteFile.szUsername));
Button downloadButton = (Button)convertView.findViewById(R.id.download_btn);
Button removeButton = (Button)convertView.findViewById(R.id.remove_btn);
@@ -330,7 +330,7 @@ public void onClick(DialogInterface dialog, int whichButton) {
}
case FILE_TRANSFER_VIEW_TYPE: {
if((convertView == null) || (convertView.findViewById(R.id.progress) == null))
convertView = inflater.inflate(R.layout.item_file_transfer, null);
convertView = inflater.inflate(R.layout.item_file_transfer, parent, false);
FileTransfer transferinfo = downloads.get(remoteFile.szFileName);
((TextView)convertView.findViewById(R.id.progress)).setText(context.getString(R.string.download_progress, getPercentage(transferinfo)));
Button cancelButton = (Button)convertView.findViewById(R.id.cancel_btn);
@@ -138,7 +138,7 @@ public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
int userid = (int) getGroupId(groupPosition);
if (convertView == null)
convertView = inflater.inflate(R.layout.item_media, null);
convertView = inflater.inflate(R.layout.item_media, parent, false);
Bitmap bmp = media_sessions.get(userid);
if (bmp != null) {
@@ -176,7 +176,7 @@ public View getGroupView(int groupPosition, boolean isExpanded,
int userid = (int) getGroupId(groupPosition);
if (convertView == null)
convertView = inflater.inflate(R.layout.item_media_user, null);
convertView = inflater.inflate(R.layout.item_media_user, parent, false);
TextView nickname = (TextView) convertView
.findViewById(R.id.media_nickname_textview);
@@ -68,7 +68,8 @@ public TextMessageAdapter(Context context, AccessibilityAssistant accessibilityA
setTextMessages(msgs);
}
@SuppressWarnings("ResourceType")
public TextMessageAdapter(Context context, AccessibilityAssistant accessibilityAssistant) {
inflater = LayoutInflater.from(context);
this.accessibilityAssistant = accessibilityAssistant;
@@ -144,7 +145,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
case TextMsgType.MSGTYPE_USER : {
if(convertView == null ||
convertView.findViewById(R.id.item_textmsg) == null)
convertView = inflater.inflate(R.layout.item_textmsg, null);
convertView = inflater.inflate(R.layout.item_textmsg, parent, false);
if(txtmsg.nFromUserID == myuserid) {
bg_color = self_bg_color;
@@ -171,7 +172,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
case MyTextMessage.MSGTYPE_SERVERPROP : {
if(convertView == null ||
convertView.findViewById(R.id.item_textmsg_srvinfo) == null) {
convertView = inflater.inflate(R.layout.item_textmsg_srvinfo, null);
convertView = inflater.inflate(R.layout.item_textmsg_srvinfo, parent, false);
}
bg_color = srvinfo_bg_color;
@@ -195,7 +196,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
default : {
if(convertView == null ||
convertView.findViewById(R.id.item_textmsg_logmsg) == null) {
convertView = inflater.inflate(R.layout.item_textmsg_logmsg, null);
convertView = inflater.inflate(R.layout.item_textmsg_logmsg, parent, false);
}
switch(txtmsg.nMsgType) {
@@ -234,15 +234,15 @@ public Fragment getItem(int position) {
default :
case TAB_OPUS :
if(opusfrag == null)
opusfrag = new OPUSFragment(opuscodec);
opusfrag = new OPUSFragment();
return opusfrag;
case TAB_SPEEX :
if(speexfrag == null)
speexfrag = new SpeexFragment(speexcodec);
speexfrag = new SpeexFragment();
return speexfrag;
case TAB_SPEEXVBR :
if(speexvbrfrag == null)
speexvbrfrag = new SpeexVBRFragment(speexvbrcodec);
speexvbrfrag = new SpeexVBRFragment();
return speexvbrfrag;
case TAB_NOAUDIO :
if(noaudiofrag == null)
@@ -279,19 +279,18 @@ public CharSequence getPageTitle(int position) {
public static class OPUSFragment extends Fragment {
OpusCodec opuscodec;
MapAdapter appMap;
MapAdapter srMap;
MapAdapter audMap;
MapAdapter delayMap;
public OPUSFragment(OpusCodec opuscodec) {
this.opuscodec = opuscodec;
public OPUSFragment() {
}
@Override
public void onAttach(Activity activity) {
opuscodec = ((AudioCodecActivity)activity).opuscodec;
appMap = new MapAdapter(activity, R.layout.item_spinner, R.id.spinTextView);
srMap = new MapAdapter(activity, R.layout.item_spinner, R.id.spinTextView);
audMap = new MapAdapter(activity, R.layout.item_spinner, R.id.spinTextView);
@@ -399,17 +398,16 @@ public void onProgressChanged(SeekBar seekBar, int progress,
public static class SpeexFragment extends Fragment {
SpeexCodec speexcodec;
MapAdapter srMap;
MapAdapter delayMap;
public SpeexFragment(SpeexCodec speexcodec) {
this.speexcodec = speexcodec;
public SpeexFragment() {
}
@Override
public void onAttach(Activity activity) {
speexcodec = ((AudioCodecActivity)activity).speexcodec;
srMap = new MapAdapter(activity, R.layout.item_spinner, R.id.spinTextView);
srMap.addPair("8 KHz", SpeexConstants.SPEEX_BANDMODE_NARROW);
srMap.addPair("16 KHz", SpeexConstants.SPEEX_BANDMODE_WIDE);
@@ -466,13 +464,12 @@ void exchangeSpeexCodec(View rootView, boolean store) {
MapAdapter srMap;
MapAdapter delayMap;
public SpeexVBRFragment(SpeexVBRCodec speexvbrcodec) {
this.speexvbrcodec = speexvbrcodec;
public SpeexVBRFragment() {
}
@Override
public void onAttach(Activity activity) {
speexvbrcodec = ((AudioCodecActivity)activity).speexvbrcodec;
srMap = new MapAdapter(activity, R.layout.item_spinner, R.id.spinTextView);
srMap.addPair("8 KHz", SpeexConstants.SPEEX_BANDMODE_NARROW);
srMap.addPair("16 KHz", SpeexConstants.SPEEX_BANDMODE_WIDE);
@@ -77,7 +77,7 @@ protected void onStart() {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null)
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_file, null);
convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_file, parent, false);
File item = getItem(position);
TextView filename = (TextView) convertView.findViewById(R.id.filename);
ImageView icon = (ImageView) convertView.findViewById(R.id.icon);
@@ -100,7 +100,7 @@ protected void onStop() {
super.onStop();
if (currentDirectory != null) {
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(getBaseContext()).edit();
editor.putString(CURRENT_DIRECTORY, currentDirectory.getAbsolutePath()).commit();
editor.putString(CURRENT_DIRECTORY, currentDirectory.getAbsolutePath()).apply();
}
}
@@ -433,12 +433,13 @@ protected void onStop() {
super.onStop();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
SharedPreferences.Editor editor = prefs.edit();
if(ttclient != null) {
if (mConnection.isBound()) {
SharedPreferences.Editor editor = prefs.edit();
editor.putInt(Preferences.PREF_SOUNDSYSTEM_MASTERVOLUME, ttclient.getSoundOutputVolume());
editor.putInt(Preferences.PREF_SOUNDSYSTEM_MICROPHONEGAIN, ttclient.getSoundInputGainLevel());
editor.putInt(Preferences.PREF_SOUNDSYSTEM_VOICEACTIVATION_LEVEL, ttclient.getVoiceActivationLevel());
editor.commit();
editor.apply();
}
// Cleanup resources
@@ -453,7 +454,7 @@ protected void onStop() {
}
// Unbind from the service
if(mConnection.isBound()) {
if (mConnection.isBound()) {
Log.d(TAG, "Unbinding TeamTalk service");
onServiceDisconnected(ttservice);
ttservice.disablePhoneCallReaction();
@@ -924,13 +925,13 @@ public View getView(int position, View convertView, ViewGroup parent) {
// show parent channel shortcut
if (convertView == null ||
convertView.findViewById(R.id.parentname) == null)
convertView = inflater.inflate(R.layout.item_channel_back, null);
convertView = inflater.inflate(R.layout.item_channel_back, parent, false);
}
else {
if (convertView == null ||
convertView.findViewById(R.id.channelname) == null)
convertView = inflater.inflate(R.layout.item_channel, null);
convertView = inflater.inflate(R.layout.item_channel, parent, false);
ImageView chanicon = (ImageView) convertView.findViewById(R.id.channelicon);
TextView name = (TextView) convertView.findViewById(R.id.channelname);
@@ -980,7 +981,7 @@ public void onClick(View v) {
else if(item instanceof User) {
if (convertView == null ||
convertView.findViewById(R.id.nickname) == null)
convertView = inflater.inflate(R.layout.item_user, null);
convertView = inflater.inflate(R.layout.item_user, parent, false);
ImageView usericon = (ImageView) convertView.findViewById(R.id.usericon);
TextView nickname = (TextView) convertView.findViewById(R.id.nickname);
TextView status = (TextView) convertView.findViewById(R.id.status);
@@ -334,7 +334,7 @@ public long getItemId(int position) {
public View getView(final int position, View convertView, ViewGroup parent) {
if(convertView == null)
convertView = inflater.inflate(R.layout.item_serverentry, null);
convertView = inflater.inflate(R.layout.item_serverentry, parent, false);
ImageView img = (ImageView) convertView.findViewById(R.id.servericon);
TextView name = (TextView) convertView.findViewById(R.id.server_name);
@@ -164,7 +164,7 @@
<string name="pref_summary_server_address">Alan adı yada Sunucunun İP Adresi</string>
<string name="channel_password_prompt">Kanal Şifresini Girin</string>
<string name="button_download">İndir</string>
<string name="download_succeeded" formatted="false">%1$s dosyası %2$s konumuna başarıyla indirildi ve qeyd edildi</string>
<string name="download_succeeded">%1$s dosyası %2$s konumuna başarıyla indirildi ve qeyd edildi</string>
<string name="download_failed">%1$s dosyası indirilirken bir sehf oldu</string>
<string name="upload_succeeded">%1$s dosyası başarıyla qarşıya yüklendi</string>
<string name="upload_failed">%1$s dosyası qarşıya yüklenirken bir sehf oldu</string>
Oops, something went wrong.

0 comments on commit fda6e0f

Please sign in to comment.