mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-14 04:55:13 -05:00
Remove ActionBarSherlock dependency and refactor code to use native ActionBar.
This commit is contained in:
parent
c813a4a79e
commit
90055e839c
@ -22,7 +22,6 @@ android {
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
|
||||
compile 'com.android.support:support-v4:22.0.0'
|
||||
|
||||
compile 'com.viewpagerindicator:library:2.4.1@aar'
|
||||
|
@ -20,9 +20,22 @@ along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.yaaic.activity;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.yaaic.R;
|
||||
import org.yaaic.Yaaic;
|
||||
@ -34,30 +47,16 @@ import org.yaaic.model.Identity;
|
||||
import org.yaaic.model.Server;
|
||||
import org.yaaic.model.Status;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.actionbarsherlock.app.ActionBar;
|
||||
import com.actionbarsherlock.app.SherlockActivity;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Add a new server to the list
|
||||
*
|
||||
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
||||
*/
|
||||
public class AddServerActivity extends SherlockActivity implements OnClickListener
|
||||
public class AddServerActivity extends Activity implements OnClickListener
|
||||
{
|
||||
private static final int REQUEST_CODE_CHANNELS = 1;
|
||||
private static final int REQUEST_CODE_COMMANDS = 2;
|
||||
@ -80,7 +79,7 @@ public class AddServerActivity extends SherlockActivity implements OnClickListen
|
||||
|
||||
setContentView(R.layout.serveradd);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
authentication = new Authentication();
|
||||
|
@ -51,6 +51,8 @@ import org.yaaic.model.User;
|
||||
import org.yaaic.receiver.ConversationReceiver;
|
||||
import org.yaaic.receiver.ServerReceiver;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ComponentName;
|
||||
import android.content.DialogInterface;
|
||||
@ -69,6 +71,9 @@ import android.support.v4.view.ViewPager;
|
||||
import android.text.InputType;
|
||||
import android.text.method.TextKeyListener;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnKeyListener;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
@ -77,18 +82,12 @@ import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.actionbarsherlock.app.ActionBar;
|
||||
import com.actionbarsherlock.app.SherlockActivity;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
/**
|
||||
* The server view with a scrollable list of all channels
|
||||
*
|
||||
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
||||
*/
|
||||
public class ConversationActivity extends SherlockActivity implements ServiceConnection, ServerListener, ConversationListener
|
||||
public class ConversationActivity extends Activity implements ServiceConnection, ServerListener, ConversationListener
|
||||
{
|
||||
public static final int REQUEST_CODE_SPEECH = 99;
|
||||
|
||||
@ -189,7 +188,7 @@ public class ConversationActivity extends SherlockActivity implements ServiceCon
|
||||
this.finish();
|
||||
}
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setTitle(server.getTitle());
|
||||
|
@ -35,6 +35,7 @@ import org.yaaic.model.Server;
|
||||
import org.yaaic.model.Status;
|
||||
import org.yaaic.receiver.ServerReceiver;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ComponentName;
|
||||
import android.content.DialogInterface;
|
||||
@ -43,6 +44,9 @@ import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
@ -50,17 +54,12 @@ import android.widget.AdapterView.OnItemLongClickListener;
|
||||
import android.widget.ListView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.actionbarsherlock.app.SherlockActivity;
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
/**
|
||||
* List of servers
|
||||
*
|
||||
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
||||
*/
|
||||
public class ServersActivity extends SherlockActivity implements ServiceConnection, ServerListener, OnItemClickListener, OnItemLongClickListener {
|
||||
public class ServersActivity extends Activity implements ServiceConnection, ServerListener, OnItemClickListener, OnItemLongClickListener {
|
||||
private IRCBinder binder;
|
||||
private ServerReceiver receiver;
|
||||
private ServerListAdapter adapter;
|
||||
|
@ -22,18 +22,17 @@ package org.yaaic.activity;
|
||||
|
||||
import org.yaaic.R;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.actionbarsherlock.app.ActionBar;
|
||||
import com.actionbarsherlock.app.SherlockPreferenceActivity;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.view.MenuItem;
|
||||
|
||||
/**
|
||||
* Settings
|
||||
*
|
||||
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
||||
*/
|
||||
public class SettingsActivity extends SherlockPreferenceActivity
|
||||
public class SettingsActivity extends PreferenceActivity
|
||||
{
|
||||
/**
|
||||
* On create
|
||||
@ -43,7 +42,7 @@ public class SettingsActivity extends SherlockPreferenceActivity
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
ActionBar actionBar = getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
addPreferencesFromResource(R.xml.preferences);
|
||||
|
Loading…
Reference in New Issue
Block a user